Given that Christmas is:

  • December
  • Month 12
  • Day 25

Every year, determine today's date, and whether or not today is Christmas. If it is Christmas, you must print "It's Christmas". If it is not Christmas, you must somehow wait until Christmas and then print "It's Christmas".


From this Stack Overflow Question

import time
while time.strftime("%b, %d", time.localtime()) != "Dec, 25":
print "It's Christmas"

Python in 115 Characters


Here are the rules:

  • Assume that the computer's clock is always right.
  • Your code must be able to be started at any time.
  • Your code must print "It's Christmas" on Christmas.
  • Looping is certainly not necessary, but once started your code should not stop until it has printed.
  • Shortest code wins.
  • \$\begingroup\$ I thought the input is in Julian date before I read this post \$\endgroup\$
    – Ming-Tang
    Dec 21, 2011 at 9:51

36 Answers 36


Q (60)

 system"t 1000";.z.ts:{if[.z.d~2012.12.25;1"It’s Christmas"]}
  • \$\begingroup\$ > If it is not Christmas, you must somehow wait until Christmas and then print "It's Christmas". \$\endgroup\$
    – skeevey
    Mar 7, 2012 at 13:55
  • \$\begingroup\$ My apologies, corrected to check every second if it's Christmas...so this will print "It's Christmas" 86,400 times every 25th December. Obviously you can alter this by increasing the timer, which is in milliseconds. \$\endgroup\$
    – sinedcm
    Mar 7, 2012 at 14:20

PHP - 49 Characters

I got this quite short, so yeah.

<?while(date("dm")!="2512");echo"It's Christmas";

EDIT: Whoops, I printed something else than It's Christmas x3


Rebol (53 chars)

wait difference 25-Dec-14 now
print "It's Christmas"

Of course the above will only wait till Xmas 2014 :)

Here's a version that will wait for next Xmas day:

next-xmas: does [
    d: now
    make date! reduce [25 12 either all [d/month = 12 d/day > 25][d/year + 1][d/year]]

wait difference next-xmas now
print "It's Christmas"

Befunge-98 (36 chars)

Requires a Unicode-capable interpreter ('𐀀 is used for a literal 65536 and 'ఙ for 3097):

s Christmas"<@,kd"It'


  • Use y with an argument of 20 to get the date field (aa+y)
  • Mask off the month & day portion by reducing mod-65536 ('𐀀%)
  • Subtract 3097 (= month * 256 + day) ('ఙ-)
  • If zero, print the string (abuses edge wrapping)
  • Otherwise repeat
  • 1
    \$\begingroup\$ Since default code-golf scoring is now in bytes, this should be at least 39 due to the multibyte characters. \$\endgroup\$
    – lirtosiast
    Jun 9, 2015 at 1:55

J, 54

'It''s Christmas'[(-^:(3 :'-.12 25-:1 2{6!:0''''')^:_)1

Groovy - 88

new Timer().schedule({print"It's Christmas"}as TimerTask,Date.parse("yyddMM","112512"))
  • 1
    \$\begingroup\$ Is all that whitespace necessary? \$\endgroup\$
    – Joey
    Dec 5, 2011 at 16:28
  • \$\begingroup\$ @Joey no, it was for the sake of readability. \$\endgroup\$ Dec 5, 2011 at 16:32
  • 6
    \$\begingroup\$ Does it work every year? Don't think so. \$\endgroup\$ Dec 8, 2011 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.