Encode the date in Christmas Eve format












43














The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be



Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


.



Your job is to take the date the program is run and encode it in Christmas Eve format.




  • If your program is run on Christmas, it should output the string "Christmas".

  • If your program is not run on Christmas, it should output the string "Christmas", followed by the string " Eve" repeated n times, where n is the number of days until Christmas.


    • Note that this must be based on the next Christmas. For example, if the day is April 26, 2019, you must do your calculation based on December 25, 2019, not any other Christmas.

    • Remember to count leap days.



  • Christmas is December 25th of every year.


This is code-golf, so the shortest code wins! Note though that the goal is not to find the shortest program in any language, but to find the shortest program in every particular language. For example, if you find the shortest C++ program, then it wins this contest for C++, even if someone finds a shorter program in Python.










share|improve this question




















  • 5




    Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
    – Black Owl Kai
    Dec 24 at 23:36






  • 20




    A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
    – Black Owl Kai
    Dec 24 at 23:38






  • 4




    @BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
    – PyRulez
    Dec 24 at 23:41






  • 1




    Can the date be a parameter?
    – Olivier Grégoire
    Dec 26 at 11:23






  • 1




    @OlivierGrégoire uhm, I'll permit it iff the language does not have the ability to get the current date in another way.
    – PyRulez
    Dec 26 at 14:53
















43














The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be



Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


.



Your job is to take the date the program is run and encode it in Christmas Eve format.




  • If your program is run on Christmas, it should output the string "Christmas".

  • If your program is not run on Christmas, it should output the string "Christmas", followed by the string " Eve" repeated n times, where n is the number of days until Christmas.


    • Note that this must be based on the next Christmas. For example, if the day is April 26, 2019, you must do your calculation based on December 25, 2019, not any other Christmas.

    • Remember to count leap days.



  • Christmas is December 25th of every year.


This is code-golf, so the shortest code wins! Note though that the goal is not to find the shortest program in any language, but to find the shortest program in every particular language. For example, if you find the shortest C++ program, then it wins this contest for C++, even if someone finds a shorter program in Python.










share|improve this question




















  • 5




    Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
    – Black Owl Kai
    Dec 24 at 23:36






  • 20




    A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
    – Black Owl Kai
    Dec 24 at 23:38






  • 4




    @BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
    – PyRulez
    Dec 24 at 23:41






  • 1




    Can the date be a parameter?
    – Olivier Grégoire
    Dec 26 at 11:23






  • 1




    @OlivierGrégoire uhm, I'll permit it iff the language does not have the ability to get the current date in another way.
    – PyRulez
    Dec 26 at 14:53














43












43








43


2





The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be



Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


.



Your job is to take the date the program is run and encode it in Christmas Eve format.




  • If your program is run on Christmas, it should output the string "Christmas".

  • If your program is not run on Christmas, it should output the string "Christmas", followed by the string " Eve" repeated n times, where n is the number of days until Christmas.


    • Note that this must be based on the next Christmas. For example, if the day is April 26, 2019, you must do your calculation based on December 25, 2019, not any other Christmas.

    • Remember to count leap days.



  • Christmas is December 25th of every year.


This is code-golf, so the shortest code wins! Note though that the goal is not to find the shortest program in any language, but to find the shortest program in every particular language. For example, if you find the shortest C++ program, then it wins this contest for C++, even if someone finds a shorter program in Python.










share|improve this question















The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be



Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


.



Your job is to take the date the program is run and encode it in Christmas Eve format.




  • If your program is run on Christmas, it should output the string "Christmas".

  • If your program is not run on Christmas, it should output the string "Christmas", followed by the string " Eve" repeated n times, where n is the number of days until Christmas.


    • Note that this must be based on the next Christmas. For example, if the day is April 26, 2019, you must do your calculation based on December 25, 2019, not any other Christmas.

    • Remember to count leap days.



  • Christmas is December 25th of every year.


This is code-golf, so the shortest code wins! Note though that the goal is not to find the shortest program in any language, but to find the shortest program in every particular language. For example, if you find the shortest C++ program, then it wins this contest for C++, even if someone finds a shorter program in Python.







code-golf string date






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 26 at 16:31

























asked Dec 24 at 23:10









PyRulez

3,55542257




3,55542257








  • 5




    Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
    – Black Owl Kai
    Dec 24 at 23:36






  • 20




    A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
    – Black Owl Kai
    Dec 24 at 23:38






  • 4




    @BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
    – PyRulez
    Dec 24 at 23:41






  • 1




    Can the date be a parameter?
    – Olivier Grégoire
    Dec 26 at 11:23






  • 1




    @OlivierGrégoire uhm, I'll permit it iff the language does not have the ability to get the current date in another way.
    – PyRulez
    Dec 26 at 14:53














  • 5




    Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
    – Black Owl Kai
    Dec 24 at 23:36






  • 20




    A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
    – Black Owl Kai
    Dec 24 at 23:38






  • 4




    @BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
    – PyRulez
    Dec 24 at 23:41






  • 1




    Can the date be a parameter?
    – Olivier Grégoire
    Dec 26 at 11:23






  • 1




    @OlivierGrégoire uhm, I'll permit it iff the language does not have the ability to get the current date in another way.
    – PyRulez
    Dec 26 at 14:53








5




5




Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
– Black Owl Kai
Dec 24 at 23:36




Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
– Black Owl Kai
Dec 24 at 23:36




20




20




A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
– Black Owl Kai
Dec 24 at 23:38




A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
– Black Owl Kai
Dec 24 at 23:38




4




4




@BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
– PyRulez
Dec 24 at 23:41




@BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
– PyRulez
Dec 24 at 23:41




1




1




Can the date be a parameter?
– Olivier Grégoire
Dec 26 at 11:23




Can the date be a parameter?
– Olivier Grégoire
Dec 26 at 11:23




1




1




@OlivierGrégoire uhm, I'll permit it iff the language does not have the ability to get the current date in another way.
– PyRulez
Dec 26 at 14:53




@OlivierGrégoire uhm, I'll permit it iff the language does not have the ability to get the current date in another way.
– PyRulez
Dec 26 at 14:53










30 Answers
30






active

oldest

votes


















44














SmileBASIC, 73 71 67 bytes



?"Christmas";
@L?" Eve"*(D!=P);
P=D
DTREAD OUT,M,D
IF M/D-.48GOTO@L


The program prints "Christmas", then prints " Eve" every time a day passes, until it is December 25th. (12/25 = 0.48)

May take up to a year to run.






share|improve this answer



















  • 7




    pure genius ...
    – FlipTack
    Dec 25 at 11:43






  • 7




    This made me Smile...
    – Neil
    Dec 25 at 14:10






  • 3




    Nice! One of my JavaScript solutions takes a similar approach. However, in JavaScript the wait time is just a best effort. How is SmileBASIC faring in this regard?
    – targumon
    Dec 26 at 0:16






  • 4




    @12Me21 that would obviously fail due to leap seconds, this version looks much better.
    – Riker
    Dec 26 at 16:08






  • 4




    +1 for thinking outside the box and making me laugh.
    – Tom
    2 days ago



















18














Excel formula, 62 bytes



="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,25)-TODAY())





share|improve this answer










New contributor




Richard Crossley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 3




    I think YEAR(TODAY()+6) always returns the correct year, thus avoiding the condition.
    – Neil
    Dec 25 at 19:32






  • 2




    I think YEAR(NOW()+6) works as well with 2 less bytes.
    – Engineer Toast
    Dec 26 at 20:01






  • 1




    I think ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,26)-NOW()) is even shorter and I believe it should work.
    – JeroendeK
    2 days ago






  • 1




    NOW() includes the time, so it won't be an integer and I'm not sure REPT would allow that.
    – 12Me21
    yesterday






  • 1




    @12Me21 REPT allows it, it floors the given number, which is why I changed the 25 to a 26.
    – JeroendeK
    yesterday



















8















R, 112 106 72 bytes



Via @digEmAll and @J.Doe





x=Sys.Date()-1;cat('Christmas');while(!grepl('12-25',x<-x+1))cat(' Eve')


Try it online!



My original answer was prior to the clarification that the code was to take the date on which the code is run as input. It could be modified as above to save many bytes but I won't bother.





function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))


Try it online!



Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.



Pick the non-negative one and cat "Christmas" with that many "Eves".






share|improve this answer























  • You only use y once so you can just use it directly for 108 bytes.
    – Giuseppe
    Dec 25 at 2:02










  • Also would z[z>=0][1] work instead of min?
    – Giuseppe
    Dec 25 at 2:03










  • 73 bytes. According to the last comment, the program must output the text based on the day it runs. Merry christmas BTW ! :D
    – digEmAll
    Dec 25 at 10:16








  • 1




    Tweaked yours for 72 bytes, @digEmAll. Merry Christmas!
    – J.Doe
    Dec 25 at 11:34



















8















Perl 6, 61 47 bytes



say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})



say 'Christmas'~' Eve'x(Date.today...^/12-25/)


Try it online!



-14 bytes (!) thanks to Jo King



Date.today ...^ /12-25/ is the sequence of dates starting today and ending the day before Christmas. (The regular expression /12-25/ is matched against the string representation of the dates.) The string " Eve" is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas".






share|improve this answer























  • Could you do "month>11" to save a byte?
    – chrixbittinx
    Dec 26 at 19:35






  • 2




    Would /12.25/ work?
    – Cows quack
    2 days ago






  • 2




    @Cowsquack no, because then it might match the year in dates like 12025-12-24
    – Jo King
    2 days ago










  • I think it's safe to assume that will never happen
    – 12Me21
    yesterday



















6















Windows PowerShell, 67 64 63 bytes





for(;1225-'{0:Md}'-f(date|% *ys $i)){$i++}'Christmas'+' eve'*$i


Try it online!



Managed to shave off 3 bytes 4 bytes (thanks Cows quack) by using the -format operator instead of .ToString(), and then subtracting the date string from the numerical value 1225 instead of doing a comparison with -ne. The resulting integer will be interpreted as a boolean for the conditional where 0 (which will happen on Christmas) is interpreted as False (don't enter the loop), and any other value is interpreted as True (enter the loop).



Since the integer is on the left now, the date string will be converted to the integer and math will be done, as opposed to the previous version where the 1225 integer was converted to string for the comparison.



Original Version






Windows PowerShell, 67 bytes





for(;(date|% *ys $i|% tost* Md)-ne1225){$i++};'Christmas'+' eve'*$i


Try it online!



Using a for loop as a while loop basically, because it's shorter. In the loop condition we check the current date (date, a shortened form of Get-Date), piped to ForEach-Object's alias %, using the form that can invoke a method by wildcarded name; in this case the method is AddDays() on the DateTime object, and the value we give it is $i.



This gets piped to ForEach-Object again to invoke the ToString() method, with format string Md (month, then day, minimal digits since we don't care for what comes next). This string is then tested to see if it's not equal -ne to the number 1225, which will be converted to a string for the comparison, saving me the quotes.



This is why it doesn't matter that the months and days are single digits, it will never be ambiguous because there's no other day of the year that would stringify to 1225.



The loop continues until the string is 1225. At the beginning of the program, $i will be zero so it will be comparing today's date, and the loop will never execute, but for any other day $i gets incremented in the loop body, so that we will have a count of how many days until the next Christmas, automatically accounting for leap years and whether or not Christmas passed this year.



After the loop we just output the string Christmas concatenated with the result of multiplying the string eve times the value of $i (which, on Christmas day, will be 0, resulting in no eves).






share|improve this answer























  • Apparently the ; after {$i++} is redundant? (also wow you took the lead over bash again)
    – Cows quack
    2 days ago










  • @Cowsquack nice! how did I not notice that?!
    – briantist
    2 days ago



















5














T-SQL, 92 bytes



SELECT 'Christmas'+REPLICATE(' Eve',DATEDIFF(DAY,GETDATE(),STR(YEAR(GETDATE()+6))+'-12-25'))





share|improve this answer





























    5















    C# (Visual C# Interactive Compiler), 89 bytes





    Write("Christmas");for(var t=DateTime.Now;$"{t:Md}"!="1225";t=t.AddDays(1))Write(" Eve");


    Try it online!



    -3 bytes thanks to @JeppeStigNielsen!



    My strategy is pretty straightforward:




    1. Initialize a loop variable t to the current date

    2. Print Eve if t is not Christmas

    3. Add a day to t and repeat


    I tried some fancier things, but this way required the fewest bytes.






    share|improve this answer























    • ...do you need to assign t to itself in the incrementor? I don't have the docs in front of me, but if not, you could save two bytes more.
      – Stackstuck
      yesterday






    • 1




      oh, it's a struct. Of course it is. Nevermind.
      – Stackstuck
      yesterday












    • You can substitute t.Month<12|t.Day!=25 with the shorter $"{t:Md}"!="1225". It uses an interpolated string and a custom DateTime formatting string.
      – Jeppe Stig Nielsen
      yesterday










    • @JeppeStigNielsen - That works, thanks for the tip!
      – dana
      yesterday



















    4















    APL (Dyalog Unicode), 76 63 bytesSBCS



    Full program. Assumes ⎕IO←0 (zero-indexing).



    ⎕CY'dfns'
    'Christmas',' Eve'⍴⍨4×12 25⍳⍨⍉2↑1↓⍉date(⍳366)+days⎕TS


    Try it online!



    ⎕CY'dfns'copy in the dfns library



    ⎕TS current time stamp as [year,month,day,hour,min,sec,ms]
    days[c] find the number of days[n] since 1899-12-31 00:00:00.000
    (⍳366) add the first 366 integers (0…365) to that
    date[c] find the dates[n] that correspond to those numbers (366×7 table; one column per unit)
     transpose (7×366 table; one row per unit)
    1↓ drop one row (the years)
    2↑ take the first two rows (months and days)
    12 25⍳⍨ find the index of the first Christmas
     multiply that by four
    ' Eve'⍴⍨ use that to reshape the character list
    'Christmas ', append that to this



    [c] code of that function
    [n] notes for that function






    share|improve this answer































      4














      PHP, 61 bytes



      Christmas<?for($t=time();date(md,$t+=86400)-1226;)echo" Eve";


      Run with -n or try it online.






      share|improve this answer





























        3















        Ruby, 80 bytes





        require'date'
        t=Date.today
        puts'Christmas'+' Eve'*(Date.new((t+6).year,12,25)-t)


        Try it online!



        Thanks to tsh for his idea






        share|improve this answer





























          3














          JavaScript, 135 131 121 92 bytes



          My first (naïve) solution (135b):



          t=new Date();n=new Date();n.setMonth(11);n.setDate(25);'Christmas'+' Eve'.repeat((n>=t?n-t:(n.setFullYear(n.getFullYear()+1)-t))/864e5)


          It sets 2 dates: now and Xmas of this year. If the latter hasn't passed yet, it just diffs them, if it has passed, diffs to next year's Xmas. Uses either diffs for the number of repeats.



          (Trying to) Think Outside the Box (131b):



          i=0;f=_=>{t=new Date();if(t.getMonth()!=11||t.getDate()!=25){i++;setTimeout(f,864e5)}else{alert('Christmas'+' Eve'.repeat(i))}};f()


          The challange specifies WHICH output is required when running the program on a given day, but doesn't specify WHEN to return it...



          This will just 'sleep' for a day, increment a counter by 1, and repeat till it's Xmas in order to give the output.



          Since JavaScript doesn't guarantee the 'sleep' time, the actual result might be off.



          It is also ugly for using the alert function, which means wer'e actually not dealing with pure JavaScript, but with browser APIs as well (we can use console.log at the cost of 6 extra bytes).



          A better approach (121b):



          t=new Date();i=0;while(t.getMonth()!=11||t.getDate()!=25){t=new Date(t.valueOf()+864e5);i++};'Christmas'+' Eve'.repeat(i)


          Starting from today, increment the date by a day until it's Xmas, then use that loop's counter for the number of repeats required.



          Improving (including going through a minifier and using 12Me21's trick to shave extra 5b) (92b):



          for(s='Christmas',t=new Date;t.getMonth()/t.getDate()-.44;)t=new Date(t*1+864e5),s+=' Eve';s





          share|improve this answer










          New contributor




          targumon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.














          • 1




            I think you can use t.getMonth()/t.getDate-.48 to check if date is not december 25th
            – 12Me21
            Dec 26 at 0:50










          • Ooh, that's sneaky! In JavaScript it actually should be .44 because the month is zero-based (but the numerator and denominator are still coprime so the fraction is unique and the idea still holds) Thanks!
            – targumon
            Dec 26 at 1:11






          • 1




            Welcome to the site! You can use a 4 space indent to make your code blocks look better.
            – Wît Wisarhd
            Dec 26 at 3:51






          • 1




            Welcome to PPCG!
            – Shaggy
            Dec 26 at 11:47










          • 98, print is needed since this is a program not a function, unless 1. you turn it into a lambda or 2. you state that you're using a REPL
            – ASCII-only
            2 days ago



















          3















          Bash, 68 65 bytes





          seq 0 366|sed 's/.*/date -d&day/e;1iChristmas
          /c 25/Q;cEve'|xargs


          Try it online!



          BSD date should be able to save a byte with something like date -v+Ad (can't test it), however, BSD sed would add more bytes to i and c, requiring them to have a <newline>.



          seq 0 366 create a stream of integers from 0 to 366



          |sed perform the following sed code over each line of stream input





          • s substitute



            • .* the pattern space




            • date -d&day with this string, with the match filling the place of &




            • e replace the pattern space with itself evaluated as bash, which computes the date & days from today in the default format of Wed Dec 26 18:22:33 UTC 2018



          • 1 on the first line of input



            • i insert





              • Christmas this string above the line, so being on top of the output




          • /c 25/ if the current line has a c 25 in it, meaning it's Dec 25



            • Q quit the program without printing the pattern space, abruptly stopping any more lines from being read



          • c (otherwise) change the current line to


            • Eve



          |xargs and convert newlines to spaces






          share|improve this answer























          • There's nothing really bash-specific about this solution. It requires GNU date, sed and seq though.
            – Kusalananda
            2 days ago










          • -4 bytes
            – Nahuel Fouilleul
            yesterday





















          3














          VBA (Excel), 108 bytes



          Copy in a blank module. Prints to the Immediate window:



          Sub X:s="Christmas":d=Now:For t=1 To (DateSerial(Year(d+6),12,25)-d):s=s &" Eve":Next:Debug.Print s:End Sub


          Note: Using : instead of line breaks saves two bytes per line.



          Notice that the VBA editor will insert additional spaces between keywords, operators, etc... and parenthesis after the Sub definition, but if you copy and paste this code it will work (I couldn't get rid of that space before the &).



          Not bad for VBA (for once).






          share|improve this answer










          New contributor




          Barranka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.














          • 1




            *Christmas :|
            – ASCII-only
            Dec 26 at 23:47












          • @ASCII-only: removing the space before the & throws an error
            – Barranka
            Dec 26 at 23:49










          • -1 bytes. Thanks to @ASCII-only for catching the typo
            – Barranka
            Dec 27 at 0:06



















          3















          Python 2, 111 103 bytes





          from datetime import*
          d=date.today()
          print"Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days


          Try it online!



          Update inspired by Richard Crossley's answer.



          Explanation:



          from datetime import*
          # get today as a date, so we don't have to worry about rounding errors due to time
          d=date.today()
          # get the year of the Christmas to compare to
          # if the current date is after this year's Christmas, the 6 day offset will give the next year
          # otherwise, returns this year
          (d+timedelta(6)).year
          # next Christmas minus the current date
          date(.....................,12,25)-d
          # Christmas, plus (number of days until next Christmas) " Eve"s
          print"Christmas"+" Eve"*(...................................).days





          share|improve this answer































            3














            Bash +GNU date, 72 73 bytes



            for((d=0;1`date +%d%m -d$dday`-12512;d++));{ x+= Eve;};echo Christmas$x



            • one byte saved replacing != with -

            • another removing extra space

            • fix -3 bytes d=0, because date -dday is date+1 and doesn't work on 25/12


            Try it online






            share|improve this answer























            • Hmmm, why does =~ not work in the for-loop conditional?
              – Cows quack
              Dec 26 at 19:14










            • because the for loop condition is an arithmetic expression, words are coerced to integer also number starting with 0 are assumed in octal, that's why 1 is prepended
              – Nahuel Fouilleul
              2 days ago





















            3














            Python 2, 128 bytes / Python 3, 130 bytes



            of course, two less bytes with Python 2



            from datetime import date as D
            T=D.today()
            Y=T.year
            a=(D(Y,12,25)-T).days
            print("Christmas"+" Eve"*[a,(D(Y+1,12,25)-T).days][a<0])





            share|improve this answer



















            • 1




              105 bytes
              – tsh
              Dec 25 at 13:00










            • @tsh That's an amazing approach!
              – iBug
              Dec 25 at 13:18






            • 1




              Python 2 doesn't need a space after print so it's 128 bytes
              – NieDzejkob
              yesterday






            • 3




              -2 bytes by implementing as D by yourself
              – NieDzejkob
              yesterday



















            2















            C (gcc), 157 bytes



            I thought that I would be able to avoid including time.h but that just gave segment faults.





            #include <time.h>
            *t,u;f(){time(&u);t=localtime(&u);t[5]+=t[4]>10&t[3]>25;t[4]=11;t[3]=25;u-=mktime(t);printf("Christmas");for(u/=86400;u++;printf(" Eve"));}


            Try it online!






            share|improve this answer























            • IMO you should leave out the #include <stdlib.h>, not like it does anything at all here
              – ASCII-only
              Dec 26 at 9:02










            • Suggest *t;f(u) instead of *t,u;f() and #import<time.h> instead of #include <time.h> and 5[t=localtime(&u)] instead of t=localtime(&u);t[5]
              – ceilingcat
              yesterday



















            2















            Groovy, 66 bytes



            d=as Date
            print'Christmas'+' Eve'*(new Date((d+6).year,11,25)-d)


            Try it online!



            Courtesy of @ASCII-only






            share|improve this answer










            New contributor




            bdkosher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.


















            • You need to print it out since this is a full program not a function
              – ASCII-only
              2 days ago












            • > Chistmas :/
              – ASCII-only
              2 days ago










            • fixed, 149
              – ASCII-only
              2 days ago










            • 123
              – ASCII-only
              2 days ago












            • taking your first one and using Groovy 2.5 slims it down to 115.
              – bdkosher
              2 days ago



















            1














            MySQL, 102 bytes



            pretty much the same as Neil´s T-SQL answer. There seems to be no shorter way in SQL.



            select concat("Christmas",repeat(" Eve",datediff(concat(year(now()+interval 6 day),"-12-25"),now())));


            Try it online.






            share|improve this answer





























              1















              Scala, 140 bytes





              import org.joda.time._
              var s="Christmas"
              var d=DateTime.now
              while(d!=d.withDate(d.year().get(),12,25)){d=d.plusDays(1);s+=" Eve"};println(s)


              Does not run in TIO since it requires Joda-Time library.






              share|improve this answer





















              • no joda, 154. sadly can't get java.util.Date to work here :/
                – ASCII-only
                2 days ago












              • 148
                – ASCII-only
                2 days ago










              • Ah @ASCII-only I did not count object Main extends App{} chars in my counting (cause I didn't in my other Scala answers either). If we take that out you beat me ^^
                – V. Courtois
                yesterday










              • The withDate() call is so expensive...
                – V. Courtois
                yesterday



















              1














              Java 8, 161 146 Bytes



              void t(){LocalDate a=LocalDate.now();
              String b="Christmas";
              while(!a.toString().endsWith("12-25")){b+=" Eve";a=a.plusDays(1);}
              System.out.print(b)}}





              share|improve this answer























              • You need to include imports in the bytecount (and since you need to import, this needs to be a full program)
                – ASCII-only
                2 days ago












              • You can save 6 bytes by changing a.toString() into (""+a).
                – Christopher Schultz
                yesterday



















              1














              Python 3, 106 Bytes



              from datetime import*
              d=date.today()
              print("Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days)





              share|improve this answer








              New contributor




              Albert Capp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.


























                1















                Scala, 116 113 bytes





                var d=new java.util.Date
                print("Christmas")
                while(!(""+d).contains("c 25")){print(" Eve");d.setDate(d.getDate+1)}


                Try it online!



                Where c 25 is short for Dec 25.






                share|improve this answer



















                • 1




                  I think you can use contains("c 25") instead of matches(".*c 25.*")
                  – 12Me21
                  12 hours ago












                • Thanks, three bytes less! 😁
                  – Kjetil S.
                  12 hours ago





















                1














                MATLAB, 91 bytes



                n=datetime
                x=datetime(year(n+6),12,25)
                s='Christmas'
                while days(x-n)>=1 n=n+1 s=[s,' Eve'] end


                MATLAB Non-looper, 100 bytes



                x=datenum(datetime(floor((now+5)/365.2425),12,25))
                d=x-now
                ['Christmas' repmat(' Eve',1,min(d(d>=0)))]





                share|improve this answer










                New contributor




                Anthony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.


























                  1














                  JavaScript 86 bytes



                  Using REPL it would be



                  for(c='Christmas',d=new Date;(d+'').indexOf('c 25')<0;d=new Date(+d+864e5))c+=' Eve';c





                  share|improve this answer








                  New contributor




                  Vadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.


























                    0















                    C# (Visual C# Interactive Compiler), 141 bytes





                    var g=DateTime.Now;Write("Christmas"+string.Concat(Enumerable.Repeat(" Eve",(new DateTime(g.Year+(g.Day>25&g.Month>11?1:0),12,25)-g).Days)));


                    Try it online!






                    share|improve this answer



















                    • 1




                      I don't think this works for the 30th of November...
                      – Neil
                      Dec 25 at 9:56










                    • Fixed now, I forgot to add a check to if it was December or not
                      – Embodiment of Ignorance
                      Dec 25 at 17:58










                    • Are you sure about Month > 25?
                      – Neil
                      Dec 25 at 19:12










                    • Fixed it now...
                      – Embodiment of Ignorance
                      Dec 25 at 20:20










                    • Is the ?1:0 nessesary? doesn't & return an integer?
                      – 12Me21
                      Dec 25 at 23:33



















                    0















                    Red, 89 86 84 78 76 bytes



                    -10 bytes thanks to ASCII-only!



                    does[a: now prin"Christmas"while[a/3 * 31 + a/4 <> 397][prin" Eve"a: a + 1]]


                    Try it online!






                    share|improve this answer























                    • 84
                      – ASCII-only
                      Dec 26 at 9:04










                    • @ASCII-only Hmm, of course! Thank you!
                      – Galen Ivanov
                      Dec 26 at 10:01












                    • 78
                      – ASCII-only
                      Dec 26 at 23:45










                    • 76
                      – ASCII-only
                      Dec 27 at 0:12










                    • @ASCII-only Your 76-byte version does not give correct result when run on Christmas: Date as an argument I feel stupid for not using only now and not now/date. Thank you for your improvements!
                      – Galen Ivanov
                      2 days ago



















                    0















                    Perl 5, 68 bytes





                    print"Christmas";print" Eve"while localtime($i++*86400+time)!~/c 25/


                    Try it online!



                    Where c 25 is short for Dec 25.






                    share|improve this answer























                    • Replace localtime with gmtime to save 3 bytes. After all, the question didn't state in which timezone Christmas is to be considered.
                      – Abigail
                      8 hours ago



















                    0














                    perl -E, 25 bytes



                    perl -E'say"Christmas"," Eve"x365'


                    This will print the required answer -- and then some extra characters. But since that wasn't explicitly forbidden, I'm just going to bend the rules. Heavily.






                    share|improve this answer





























                      -1














                      PHP, 84 bytes



                      Probably doesn't work that well.



                      $d=intval(date("z"));echo("Christmas ".str_repeat("Eve ",(358-$d)<0?724-$d:358-$d));





                      share|improve this answer

















                      • 2




                        Will this work in leap year?
                        – tsh
                        Dec 25 at 13:02










                      • No sir it will NOT. I have no idea how to implement that.
                        – Adrian Zhang
                        Dec 25 at 17:31












                      • a little long, but a nice approach. Take a look at date("L"): 1 for leap year, 0 otherwise. Don´t forget to use it for the next year too. Try ($d=date(z))>359; you can use Christmas<?= that way.
                        – Titus
                        Dec 25 at 20:05













                      Your Answer





                      StackExchange.ifUsing("editor", function () {
                      return StackExchange.using("mathjaxEditing", function () {
                      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
                      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
                      });
                      });
                      }, "mathjax-editing");

                      StackExchange.ifUsing("editor", function () {
                      StackExchange.using("externalEditor", function () {
                      StackExchange.using("snippets", function () {
                      StackExchange.snippets.init();
                      });
                      });
                      }, "code-snippets");

                      StackExchange.ready(function() {
                      var channelOptions = {
                      tags: "".split(" "),
                      id: "200"
                      };
                      initTagRenderer("".split(" "), "".split(" "), channelOptions);

                      StackExchange.using("externalEditor", function() {
                      // Have to fire editor after snippets, if snippets enabled
                      if (StackExchange.settings.snippets.snippetsEnabled) {
                      StackExchange.using("snippets", function() {
                      createEditor();
                      });
                      }
                      else {
                      createEditor();
                      }
                      });

                      function createEditor() {
                      StackExchange.prepareEditor({
                      heartbeatType: 'answer',
                      autoActivateHeartbeat: false,
                      convertImagesToLinks: false,
                      noModals: true,
                      showLowRepImageUploadWarning: true,
                      reputationToPostImages: null,
                      bindNavPrevention: true,
                      postfix: "",
                      imageUploader: {
                      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                      allowUrls: true
                      },
                      onDemand: true,
                      discardSelector: ".discard-answer"
                      ,immediatelyShowMarkdownHelp:true
                      });


                      }
                      });














                      draft saved

                      draft discarded


















                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f178003%2fencode-the-date-in-christmas-eve-format%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown

























                      30 Answers
                      30






                      active

                      oldest

                      votes








                      30 Answers
                      30






                      active

                      oldest

                      votes









                      active

                      oldest

                      votes






                      active

                      oldest

                      votes









                      44














                      SmileBASIC, 73 71 67 bytes



                      ?"Christmas";
                      @L?" Eve"*(D!=P);
                      P=D
                      DTREAD OUT,M,D
                      IF M/D-.48GOTO@L


                      The program prints "Christmas", then prints " Eve" every time a day passes, until it is December 25th. (12/25 = 0.48)

                      May take up to a year to run.






                      share|improve this answer



















                      • 7




                        pure genius ...
                        – FlipTack
                        Dec 25 at 11:43






                      • 7




                        This made me Smile...
                        – Neil
                        Dec 25 at 14:10






                      • 3




                        Nice! One of my JavaScript solutions takes a similar approach. However, in JavaScript the wait time is just a best effort. How is SmileBASIC faring in this regard?
                        – targumon
                        Dec 26 at 0:16






                      • 4




                        @12Me21 that would obviously fail due to leap seconds, this version looks much better.
                        – Riker
                        Dec 26 at 16:08






                      • 4




                        +1 for thinking outside the box and making me laugh.
                        – Tom
                        2 days ago
















                      44














                      SmileBASIC, 73 71 67 bytes



                      ?"Christmas";
                      @L?" Eve"*(D!=P);
                      P=D
                      DTREAD OUT,M,D
                      IF M/D-.48GOTO@L


                      The program prints "Christmas", then prints " Eve" every time a day passes, until it is December 25th. (12/25 = 0.48)

                      May take up to a year to run.






                      share|improve this answer



















                      • 7




                        pure genius ...
                        – FlipTack
                        Dec 25 at 11:43






                      • 7




                        This made me Smile...
                        – Neil
                        Dec 25 at 14:10






                      • 3




                        Nice! One of my JavaScript solutions takes a similar approach. However, in JavaScript the wait time is just a best effort. How is SmileBASIC faring in this regard?
                        – targumon
                        Dec 26 at 0:16






                      • 4




                        @12Me21 that would obviously fail due to leap seconds, this version looks much better.
                        – Riker
                        Dec 26 at 16:08






                      • 4




                        +1 for thinking outside the box and making me laugh.
                        – Tom
                        2 days ago














                      44












                      44








                      44






                      SmileBASIC, 73 71 67 bytes



                      ?"Christmas";
                      @L?" Eve"*(D!=P);
                      P=D
                      DTREAD OUT,M,D
                      IF M/D-.48GOTO@L


                      The program prints "Christmas", then prints " Eve" every time a day passes, until it is December 25th. (12/25 = 0.48)

                      May take up to a year to run.






                      share|improve this answer














                      SmileBASIC, 73 71 67 bytes



                      ?"Christmas";
                      @L?" Eve"*(D!=P);
                      P=D
                      DTREAD OUT,M,D
                      IF M/D-.48GOTO@L


                      The program prints "Christmas", then prints " Eve" every time a day passes, until it is December 25th. (12/25 = 0.48)

                      May take up to a year to run.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited 2 days ago

























                      answered Dec 25 at 11:37









                      12Me21

                      5,34711236




                      5,34711236








                      • 7




                        pure genius ...
                        – FlipTack
                        Dec 25 at 11:43






                      • 7




                        This made me Smile...
                        – Neil
                        Dec 25 at 14:10






                      • 3




                        Nice! One of my JavaScript solutions takes a similar approach. However, in JavaScript the wait time is just a best effort. How is SmileBASIC faring in this regard?
                        – targumon
                        Dec 26 at 0:16






                      • 4




                        @12Me21 that would obviously fail due to leap seconds, this version looks much better.
                        – Riker
                        Dec 26 at 16:08






                      • 4




                        +1 for thinking outside the box and making me laugh.
                        – Tom
                        2 days ago














                      • 7




                        pure genius ...
                        – FlipTack
                        Dec 25 at 11:43






                      • 7




                        This made me Smile...
                        – Neil
                        Dec 25 at 14:10






                      • 3




                        Nice! One of my JavaScript solutions takes a similar approach. However, in JavaScript the wait time is just a best effort. How is SmileBASIC faring in this regard?
                        – targumon
                        Dec 26 at 0:16






                      • 4




                        @12Me21 that would obviously fail due to leap seconds, this version looks much better.
                        – Riker
                        Dec 26 at 16:08






                      • 4




                        +1 for thinking outside the box and making me laugh.
                        – Tom
                        2 days ago








                      7




                      7




                      pure genius ...
                      – FlipTack
                      Dec 25 at 11:43




                      pure genius ...
                      – FlipTack
                      Dec 25 at 11:43




                      7




                      7




                      This made me Smile...
                      – Neil
                      Dec 25 at 14:10




                      This made me Smile...
                      – Neil
                      Dec 25 at 14:10




                      3




                      3




                      Nice! One of my JavaScript solutions takes a similar approach. However, in JavaScript the wait time is just a best effort. How is SmileBASIC faring in this regard?
                      – targumon
                      Dec 26 at 0:16




                      Nice! One of my JavaScript solutions takes a similar approach. However, in JavaScript the wait time is just a best effort. How is SmileBASIC faring in this regard?
                      – targumon
                      Dec 26 at 0:16




                      4




                      4




                      @12Me21 that would obviously fail due to leap seconds, this version looks much better.
                      – Riker
                      Dec 26 at 16:08




                      @12Me21 that would obviously fail due to leap seconds, this version looks much better.
                      – Riker
                      Dec 26 at 16:08




                      4




                      4




                      +1 for thinking outside the box and making me laugh.
                      – Tom
                      2 days ago




                      +1 for thinking outside the box and making me laugh.
                      – Tom
                      2 days ago











                      18














                      Excel formula, 62 bytes



                      ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,25)-TODAY())





                      share|improve this answer










                      New contributor




                      Richard Crossley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.














                      • 3




                        I think YEAR(TODAY()+6) always returns the correct year, thus avoiding the condition.
                        – Neil
                        Dec 25 at 19:32






                      • 2




                        I think YEAR(NOW()+6) works as well with 2 less bytes.
                        – Engineer Toast
                        Dec 26 at 20:01






                      • 1




                        I think ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,26)-NOW()) is even shorter and I believe it should work.
                        – JeroendeK
                        2 days ago






                      • 1




                        NOW() includes the time, so it won't be an integer and I'm not sure REPT would allow that.
                        – 12Me21
                        yesterday






                      • 1




                        @12Me21 REPT allows it, it floors the given number, which is why I changed the 25 to a 26.
                        – JeroendeK
                        yesterday
















                      18














                      Excel formula, 62 bytes



                      ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,25)-TODAY())





                      share|improve this answer










                      New contributor




                      Richard Crossley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.














                      • 3




                        I think YEAR(TODAY()+6) always returns the correct year, thus avoiding the condition.
                        – Neil
                        Dec 25 at 19:32






                      • 2




                        I think YEAR(NOW()+6) works as well with 2 less bytes.
                        – Engineer Toast
                        Dec 26 at 20:01






                      • 1




                        I think ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,26)-NOW()) is even shorter and I believe it should work.
                        – JeroendeK
                        2 days ago






                      • 1




                        NOW() includes the time, so it won't be an integer and I'm not sure REPT would allow that.
                        – 12Me21
                        yesterday






                      • 1




                        @12Me21 REPT allows it, it floors the given number, which is why I changed the 25 to a 26.
                        – JeroendeK
                        yesterday














                      18












                      18








                      18






                      Excel formula, 62 bytes



                      ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,25)-TODAY())





                      share|improve this answer










                      New contributor




                      Richard Crossley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      Excel formula, 62 bytes



                      ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,25)-TODAY())






                      share|improve this answer










                      New contributor




                      Richard Crossley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      share|improve this answer



                      share|improve this answer








                      edited Dec 27 at 1:48





















                      New contributor




                      Richard Crossley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      answered Dec 25 at 13:33









                      Richard Crossley

                      1815




                      1815




                      New contributor




                      Richard Crossley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





                      New contributor





                      Richard Crossley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.






                      Richard Crossley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.








                      • 3




                        I think YEAR(TODAY()+6) always returns the correct year, thus avoiding the condition.
                        – Neil
                        Dec 25 at 19:32






                      • 2




                        I think YEAR(NOW()+6) works as well with 2 less bytes.
                        – Engineer Toast
                        Dec 26 at 20:01






                      • 1




                        I think ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,26)-NOW()) is even shorter and I believe it should work.
                        – JeroendeK
                        2 days ago






                      • 1




                        NOW() includes the time, so it won't be an integer and I'm not sure REPT would allow that.
                        – 12Me21
                        yesterday






                      • 1




                        @12Me21 REPT allows it, it floors the given number, which is why I changed the 25 to a 26.
                        – JeroendeK
                        yesterday














                      • 3




                        I think YEAR(TODAY()+6) always returns the correct year, thus avoiding the condition.
                        – Neil
                        Dec 25 at 19:32






                      • 2




                        I think YEAR(NOW()+6) works as well with 2 less bytes.
                        – Engineer Toast
                        Dec 26 at 20:01






                      • 1




                        I think ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,26)-NOW()) is even shorter and I believe it should work.
                        – JeroendeK
                        2 days ago






                      • 1




                        NOW() includes the time, so it won't be an integer and I'm not sure REPT would allow that.
                        – 12Me21
                        yesterday






                      • 1




                        @12Me21 REPT allows it, it floors the given number, which is why I changed the 25 to a 26.
                        – JeroendeK
                        yesterday








                      3




                      3




                      I think YEAR(TODAY()+6) always returns the correct year, thus avoiding the condition.
                      – Neil
                      Dec 25 at 19:32




                      I think YEAR(TODAY()+6) always returns the correct year, thus avoiding the condition.
                      – Neil
                      Dec 25 at 19:32




                      2




                      2




                      I think YEAR(NOW()+6) works as well with 2 less bytes.
                      – Engineer Toast
                      Dec 26 at 20:01




                      I think YEAR(NOW()+6) works as well with 2 less bytes.
                      – Engineer Toast
                      Dec 26 at 20:01




                      1




                      1




                      I think ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,26)-NOW()) is even shorter and I believe it should work.
                      – JeroendeK
                      2 days ago




                      I think ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,26)-NOW()) is even shorter and I believe it should work.
                      – JeroendeK
                      2 days ago




                      1




                      1




                      NOW() includes the time, so it won't be an integer and I'm not sure REPT would allow that.
                      – 12Me21
                      yesterday




                      NOW() includes the time, so it won't be an integer and I'm not sure REPT would allow that.
                      – 12Me21
                      yesterday




                      1




                      1




                      @12Me21 REPT allows it, it floors the given number, which is why I changed the 25 to a 26.
                      – JeroendeK
                      yesterday




                      @12Me21 REPT allows it, it floors the given number, which is why I changed the 25 to a 26.
                      – JeroendeK
                      yesterday











                      8















                      R, 112 106 72 bytes



                      Via @digEmAll and @J.Doe





                      x=Sys.Date()-1;cat('Christmas');while(!grepl('12-25',x<-x+1))cat(' Eve')


                      Try it online!



                      My original answer was prior to the clarification that the code was to take the date on which the code is run as input. It could be modified as above to save many bytes but I won't bother.





                      function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))


                      Try it online!



                      Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.



                      Pick the non-negative one and cat "Christmas" with that many "Eves".






                      share|improve this answer























                      • You only use y once so you can just use it directly for 108 bytes.
                        – Giuseppe
                        Dec 25 at 2:02










                      • Also would z[z>=0][1] work instead of min?
                        – Giuseppe
                        Dec 25 at 2:03










                      • 73 bytes. According to the last comment, the program must output the text based on the day it runs. Merry christmas BTW ! :D
                        – digEmAll
                        Dec 25 at 10:16








                      • 1




                        Tweaked yours for 72 bytes, @digEmAll. Merry Christmas!
                        – J.Doe
                        Dec 25 at 11:34
















                      8















                      R, 112 106 72 bytes



                      Via @digEmAll and @J.Doe





                      x=Sys.Date()-1;cat('Christmas');while(!grepl('12-25',x<-x+1))cat(' Eve')


                      Try it online!



                      My original answer was prior to the clarification that the code was to take the date on which the code is run as input. It could be modified as above to save many bytes but I won't bother.





                      function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))


                      Try it online!



                      Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.



                      Pick the non-negative one and cat "Christmas" with that many "Eves".






                      share|improve this answer























                      • You only use y once so you can just use it directly for 108 bytes.
                        – Giuseppe
                        Dec 25 at 2:02










                      • Also would z[z>=0][1] work instead of min?
                        – Giuseppe
                        Dec 25 at 2:03










                      • 73 bytes. According to the last comment, the program must output the text based on the day it runs. Merry christmas BTW ! :D
                        – digEmAll
                        Dec 25 at 10:16








                      • 1




                        Tweaked yours for 72 bytes, @digEmAll. Merry Christmas!
                        – J.Doe
                        Dec 25 at 11:34














                      8












                      8








                      8







                      R, 112 106 72 bytes



                      Via @digEmAll and @J.Doe





                      x=Sys.Date()-1;cat('Christmas');while(!grepl('12-25',x<-x+1))cat(' Eve')


                      Try it online!



                      My original answer was prior to the clarification that the code was to take the date on which the code is run as input. It could be modified as above to save many bytes but I won't bother.





                      function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))


                      Try it online!



                      Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.



                      Pick the non-negative one and cat "Christmas" with that many "Eves".






                      share|improve this answer















                      R, 112 106 72 bytes



                      Via @digEmAll and @J.Doe





                      x=Sys.Date()-1;cat('Christmas');while(!grepl('12-25',x<-x+1))cat(' Eve')


                      Try it online!



                      My original answer was prior to the clarification that the code was to take the date on which the code is run as input. It could be modified as above to save many bytes but I won't bother.





                      function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))


                      Try it online!



                      Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.



                      Pick the non-negative one and cat "Christmas" with that many "Eves".







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Dec 26 at 16:35

























                      answered Dec 25 at 1:56









                      ngm

                      3,27924




                      3,27924












                      • You only use y once so you can just use it directly for 108 bytes.
                        – Giuseppe
                        Dec 25 at 2:02










                      • Also would z[z>=0][1] work instead of min?
                        – Giuseppe
                        Dec 25 at 2:03










                      • 73 bytes. According to the last comment, the program must output the text based on the day it runs. Merry christmas BTW ! :D
                        – digEmAll
                        Dec 25 at 10:16








                      • 1




                        Tweaked yours for 72 bytes, @digEmAll. Merry Christmas!
                        – J.Doe
                        Dec 25 at 11:34


















                      • You only use y once so you can just use it directly for 108 bytes.
                        – Giuseppe
                        Dec 25 at 2:02










                      • Also would z[z>=0][1] work instead of min?
                        – Giuseppe
                        Dec 25 at 2:03










                      • 73 bytes. According to the last comment, the program must output the text based on the day it runs. Merry christmas BTW ! :D
                        – digEmAll
                        Dec 25 at 10:16








                      • 1




                        Tweaked yours for 72 bytes, @digEmAll. Merry Christmas!
                        – J.Doe
                        Dec 25 at 11:34
















                      You only use y once so you can just use it directly for 108 bytes.
                      – Giuseppe
                      Dec 25 at 2:02




                      You only use y once so you can just use it directly for 108 bytes.
                      – Giuseppe
                      Dec 25 at 2:02












                      Also would z[z>=0][1] work instead of min?
                      – Giuseppe
                      Dec 25 at 2:03




                      Also would z[z>=0][1] work instead of min?
                      – Giuseppe
                      Dec 25 at 2:03












                      73 bytes. According to the last comment, the program must output the text based on the day it runs. Merry christmas BTW ! :D
                      – digEmAll
                      Dec 25 at 10:16






                      73 bytes. According to the last comment, the program must output the text based on the day it runs. Merry christmas BTW ! :D
                      – digEmAll
                      Dec 25 at 10:16






                      1




                      1




                      Tweaked yours for 72 bytes, @digEmAll. Merry Christmas!
                      – J.Doe
                      Dec 25 at 11:34




                      Tweaked yours for 72 bytes, @digEmAll. Merry Christmas!
                      – J.Doe
                      Dec 25 at 11:34











                      8















                      Perl 6, 61 47 bytes



                      say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})



                      say 'Christmas'~' Eve'x(Date.today...^/12-25/)


                      Try it online!



                      -14 bytes (!) thanks to Jo King



                      Date.today ...^ /12-25/ is the sequence of dates starting today and ending the day before Christmas. (The regular expression /12-25/ is matched against the string representation of the dates.) The string " Eve" is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas".






                      share|improve this answer























                      • Could you do "month>11" to save a byte?
                        – chrixbittinx
                        Dec 26 at 19:35






                      • 2




                        Would /12.25/ work?
                        – Cows quack
                        2 days ago






                      • 2




                        @Cowsquack no, because then it might match the year in dates like 12025-12-24
                        – Jo King
                        2 days ago










                      • I think it's safe to assume that will never happen
                        – 12Me21
                        yesterday
















                      8















                      Perl 6, 61 47 bytes



                      say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})



                      say 'Christmas'~' Eve'x(Date.today...^/12-25/)


                      Try it online!



                      -14 bytes (!) thanks to Jo King



                      Date.today ...^ /12-25/ is the sequence of dates starting today and ending the day before Christmas. (The regular expression /12-25/ is matched against the string representation of the dates.) The string " Eve" is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas".






                      share|improve this answer























                      • Could you do "month>11" to save a byte?
                        – chrixbittinx
                        Dec 26 at 19:35






                      • 2




                        Would /12.25/ work?
                        – Cows quack
                        2 days ago






                      • 2




                        @Cowsquack no, because then it might match the year in dates like 12025-12-24
                        – Jo King
                        2 days ago










                      • I think it's safe to assume that will never happen
                        – 12Me21
                        yesterday














                      8












                      8








                      8







                      Perl 6, 61 47 bytes



                      say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})



                      say 'Christmas'~' Eve'x(Date.today...^/12-25/)


                      Try it online!



                      -14 bytes (!) thanks to Jo King



                      Date.today ...^ /12-25/ is the sequence of dates starting today and ending the day before Christmas. (The regular expression /12-25/ is matched against the string representation of the dates.) The string " Eve" is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas".






                      share|improve this answer















                      Perl 6, 61 47 bytes



                      say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})



                      say 'Christmas'~' Eve'x(Date.today...^/12-25/)


                      Try it online!



                      -14 bytes (!) thanks to Jo King



                      Date.today ...^ /12-25/ is the sequence of dates starting today and ending the day before Christmas. (The regular expression /12-25/ is matched against the string representation of the dates.) The string " Eve" is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas".







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Dec 27 at 3:16

























                      answered Dec 25 at 3:20









                      Sean

                      3,36636




                      3,36636












                      • Could you do "month>11" to save a byte?
                        – chrixbittinx
                        Dec 26 at 19:35






                      • 2




                        Would /12.25/ work?
                        – Cows quack
                        2 days ago






                      • 2




                        @Cowsquack no, because then it might match the year in dates like 12025-12-24
                        – Jo King
                        2 days ago










                      • I think it's safe to assume that will never happen
                        – 12Me21
                        yesterday


















                      • Could you do "month>11" to save a byte?
                        – chrixbittinx
                        Dec 26 at 19:35






                      • 2




                        Would /12.25/ work?
                        – Cows quack
                        2 days ago






                      • 2




                        @Cowsquack no, because then it might match the year in dates like 12025-12-24
                        – Jo King
                        2 days ago










                      • I think it's safe to assume that will never happen
                        – 12Me21
                        yesterday
















                      Could you do "month>11" to save a byte?
                      – chrixbittinx
                      Dec 26 at 19:35




                      Could you do "month>11" to save a byte?
                      – chrixbittinx
                      Dec 26 at 19:35




                      2




                      2




                      Would /12.25/ work?
                      – Cows quack
                      2 days ago




                      Would /12.25/ work?
                      – Cows quack
                      2 days ago




                      2




                      2




                      @Cowsquack no, because then it might match the year in dates like 12025-12-24
                      – Jo King
                      2 days ago




                      @Cowsquack no, because then it might match the year in dates like 12025-12-24
                      – Jo King
                      2 days ago












                      I think it's safe to assume that will never happen
                      – 12Me21
                      yesterday




                      I think it's safe to assume that will never happen
                      – 12Me21
                      yesterday











                      6















                      Windows PowerShell, 67 64 63 bytes





                      for(;1225-'{0:Md}'-f(date|% *ys $i)){$i++}'Christmas'+' eve'*$i


                      Try it online!



                      Managed to shave off 3 bytes 4 bytes (thanks Cows quack) by using the -format operator instead of .ToString(), and then subtracting the date string from the numerical value 1225 instead of doing a comparison with -ne. The resulting integer will be interpreted as a boolean for the conditional where 0 (which will happen on Christmas) is interpreted as False (don't enter the loop), and any other value is interpreted as True (enter the loop).



                      Since the integer is on the left now, the date string will be converted to the integer and math will be done, as opposed to the previous version where the 1225 integer was converted to string for the comparison.



                      Original Version






                      Windows PowerShell, 67 bytes





                      for(;(date|% *ys $i|% tost* Md)-ne1225){$i++};'Christmas'+' eve'*$i


                      Try it online!



                      Using a for loop as a while loop basically, because it's shorter. In the loop condition we check the current date (date, a shortened form of Get-Date), piped to ForEach-Object's alias %, using the form that can invoke a method by wildcarded name; in this case the method is AddDays() on the DateTime object, and the value we give it is $i.



                      This gets piped to ForEach-Object again to invoke the ToString() method, with format string Md (month, then day, minimal digits since we don't care for what comes next). This string is then tested to see if it's not equal -ne to the number 1225, which will be converted to a string for the comparison, saving me the quotes.



                      This is why it doesn't matter that the months and days are single digits, it will never be ambiguous because there's no other day of the year that would stringify to 1225.



                      The loop continues until the string is 1225. At the beginning of the program, $i will be zero so it will be comparing today's date, and the loop will never execute, but for any other day $i gets incremented in the loop body, so that we will have a count of how many days until the next Christmas, automatically accounting for leap years and whether or not Christmas passed this year.



                      After the loop we just output the string Christmas concatenated with the result of multiplying the string eve times the value of $i (which, on Christmas day, will be 0, resulting in no eves).






                      share|improve this answer























                      • Apparently the ; after {$i++} is redundant? (also wow you took the lead over bash again)
                        – Cows quack
                        2 days ago










                      • @Cowsquack nice! how did I not notice that?!
                        – briantist
                        2 days ago
















                      6















                      Windows PowerShell, 67 64 63 bytes





                      for(;1225-'{0:Md}'-f(date|% *ys $i)){$i++}'Christmas'+' eve'*$i


                      Try it online!



                      Managed to shave off 3 bytes 4 bytes (thanks Cows quack) by using the -format operator instead of .ToString(), and then subtracting the date string from the numerical value 1225 instead of doing a comparison with -ne. The resulting integer will be interpreted as a boolean for the conditional where 0 (which will happen on Christmas) is interpreted as False (don't enter the loop), and any other value is interpreted as True (enter the loop).



                      Since the integer is on the left now, the date string will be converted to the integer and math will be done, as opposed to the previous version where the 1225 integer was converted to string for the comparison.



                      Original Version






                      Windows PowerShell, 67 bytes





                      for(;(date|% *ys $i|% tost* Md)-ne1225){$i++};'Christmas'+' eve'*$i


                      Try it online!



                      Using a for loop as a while loop basically, because it's shorter. In the loop condition we check the current date (date, a shortened form of Get-Date), piped to ForEach-Object's alias %, using the form that can invoke a method by wildcarded name; in this case the method is AddDays() on the DateTime object, and the value we give it is $i.



                      This gets piped to ForEach-Object again to invoke the ToString() method, with format string Md (month, then day, minimal digits since we don't care for what comes next). This string is then tested to see if it's not equal -ne to the number 1225, which will be converted to a string for the comparison, saving me the quotes.



                      This is why it doesn't matter that the months and days are single digits, it will never be ambiguous because there's no other day of the year that would stringify to 1225.



                      The loop continues until the string is 1225. At the beginning of the program, $i will be zero so it will be comparing today's date, and the loop will never execute, but for any other day $i gets incremented in the loop body, so that we will have a count of how many days until the next Christmas, automatically accounting for leap years and whether or not Christmas passed this year.



                      After the loop we just output the string Christmas concatenated with the result of multiplying the string eve times the value of $i (which, on Christmas day, will be 0, resulting in no eves).






                      share|improve this answer























                      • Apparently the ; after {$i++} is redundant? (also wow you took the lead over bash again)
                        – Cows quack
                        2 days ago










                      • @Cowsquack nice! how did I not notice that?!
                        – briantist
                        2 days ago














                      6












                      6








                      6







                      Windows PowerShell, 67 64 63 bytes





                      for(;1225-'{0:Md}'-f(date|% *ys $i)){$i++}'Christmas'+' eve'*$i


                      Try it online!



                      Managed to shave off 3 bytes 4 bytes (thanks Cows quack) by using the -format operator instead of .ToString(), and then subtracting the date string from the numerical value 1225 instead of doing a comparison with -ne. The resulting integer will be interpreted as a boolean for the conditional where 0 (which will happen on Christmas) is interpreted as False (don't enter the loop), and any other value is interpreted as True (enter the loop).



                      Since the integer is on the left now, the date string will be converted to the integer and math will be done, as opposed to the previous version where the 1225 integer was converted to string for the comparison.



                      Original Version






                      Windows PowerShell, 67 bytes





                      for(;(date|% *ys $i|% tost* Md)-ne1225){$i++};'Christmas'+' eve'*$i


                      Try it online!



                      Using a for loop as a while loop basically, because it's shorter. In the loop condition we check the current date (date, a shortened form of Get-Date), piped to ForEach-Object's alias %, using the form that can invoke a method by wildcarded name; in this case the method is AddDays() on the DateTime object, and the value we give it is $i.



                      This gets piped to ForEach-Object again to invoke the ToString() method, with format string Md (month, then day, minimal digits since we don't care for what comes next). This string is then tested to see if it's not equal -ne to the number 1225, which will be converted to a string for the comparison, saving me the quotes.



                      This is why it doesn't matter that the months and days are single digits, it will never be ambiguous because there's no other day of the year that would stringify to 1225.



                      The loop continues until the string is 1225. At the beginning of the program, $i will be zero so it will be comparing today's date, and the loop will never execute, but for any other day $i gets incremented in the loop body, so that we will have a count of how many days until the next Christmas, automatically accounting for leap years and whether or not Christmas passed this year.



                      After the loop we just output the string Christmas concatenated with the result of multiplying the string eve times the value of $i (which, on Christmas day, will be 0, resulting in no eves).






                      share|improve this answer















                      Windows PowerShell, 67 64 63 bytes





                      for(;1225-'{0:Md}'-f(date|% *ys $i)){$i++}'Christmas'+' eve'*$i


                      Try it online!



                      Managed to shave off 3 bytes 4 bytes (thanks Cows quack) by using the -format operator instead of .ToString(), and then subtracting the date string from the numerical value 1225 instead of doing a comparison with -ne. The resulting integer will be interpreted as a boolean for the conditional where 0 (which will happen on Christmas) is interpreted as False (don't enter the loop), and any other value is interpreted as True (enter the loop).



                      Since the integer is on the left now, the date string will be converted to the integer and math will be done, as opposed to the previous version where the 1225 integer was converted to string for the comparison.



                      Original Version






                      Windows PowerShell, 67 bytes





                      for(;(date|% *ys $i|% tost* Md)-ne1225){$i++};'Christmas'+' eve'*$i


                      Try it online!



                      Using a for loop as a while loop basically, because it's shorter. In the loop condition we check the current date (date, a shortened form of Get-Date), piped to ForEach-Object's alias %, using the form that can invoke a method by wildcarded name; in this case the method is AddDays() on the DateTime object, and the value we give it is $i.



                      This gets piped to ForEach-Object again to invoke the ToString() method, with format string Md (month, then day, minimal digits since we don't care for what comes next). This string is then tested to see if it's not equal -ne to the number 1225, which will be converted to a string for the comparison, saving me the quotes.



                      This is why it doesn't matter that the months and days are single digits, it will never be ambiguous because there's no other day of the year that would stringify to 1225.



                      The loop continues until the string is 1225. At the beginning of the program, $i will be zero so it will be comparing today's date, and the loop will never execute, but for any other day $i gets incremented in the loop body, so that we will have a count of how many days until the next Christmas, automatically accounting for leap years and whether or not Christmas passed this year.



                      After the loop we just output the string Christmas concatenated with the result of multiplying the string eve times the value of $i (which, on Christmas day, will be 0, resulting in no eves).







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited 2 days ago

























                      answered Dec 26 at 12:40









                      briantist

                      2,970920




                      2,970920












                      • Apparently the ; after {$i++} is redundant? (also wow you took the lead over bash again)
                        – Cows quack
                        2 days ago










                      • @Cowsquack nice! how did I not notice that?!
                        – briantist
                        2 days ago


















                      • Apparently the ; after {$i++} is redundant? (also wow you took the lead over bash again)
                        – Cows quack
                        2 days ago










                      • @Cowsquack nice! how did I not notice that?!
                        – briantist
                        2 days ago
















                      Apparently the ; after {$i++} is redundant? (also wow you took the lead over bash again)
                      – Cows quack
                      2 days ago




                      Apparently the ; after {$i++} is redundant? (also wow you took the lead over bash again)
                      – Cows quack
                      2 days ago












                      @Cowsquack nice! how did I not notice that?!
                      – briantist
                      2 days ago




                      @Cowsquack nice! how did I not notice that?!
                      – briantist
                      2 days ago











                      5














                      T-SQL, 92 bytes



                      SELECT 'Christmas'+REPLICATE(' Eve',DATEDIFF(DAY,GETDATE(),STR(YEAR(GETDATE()+6))+'-12-25'))





                      share|improve this answer


























                        5














                        T-SQL, 92 bytes



                        SELECT 'Christmas'+REPLICATE(' Eve',DATEDIFF(DAY,GETDATE(),STR(YEAR(GETDATE()+6))+'-12-25'))





                        share|improve this answer
























                          5












                          5








                          5






                          T-SQL, 92 bytes



                          SELECT 'Christmas'+REPLICATE(' Eve',DATEDIFF(DAY,GETDATE(),STR(YEAR(GETDATE()+6))+'-12-25'))





                          share|improve this answer












                          T-SQL, 92 bytes



                          SELECT 'Christmas'+REPLICATE(' Eve',DATEDIFF(DAY,GETDATE(),STR(YEAR(GETDATE()+6))+'-12-25'))






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 25 at 20:00









                          Neil

                          79.3k744177




                          79.3k744177























                              5















                              C# (Visual C# Interactive Compiler), 89 bytes





                              Write("Christmas");for(var t=DateTime.Now;$"{t:Md}"!="1225";t=t.AddDays(1))Write(" Eve");


                              Try it online!



                              -3 bytes thanks to @JeppeStigNielsen!



                              My strategy is pretty straightforward:




                              1. Initialize a loop variable t to the current date

                              2. Print Eve if t is not Christmas

                              3. Add a day to t and repeat


                              I tried some fancier things, but this way required the fewest bytes.






                              share|improve this answer























                              • ...do you need to assign t to itself in the incrementor? I don't have the docs in front of me, but if not, you could save two bytes more.
                                – Stackstuck
                                yesterday






                              • 1




                                oh, it's a struct. Of course it is. Nevermind.
                                – Stackstuck
                                yesterday












                              • You can substitute t.Month<12|t.Day!=25 with the shorter $"{t:Md}"!="1225". It uses an interpolated string and a custom DateTime formatting string.
                                – Jeppe Stig Nielsen
                                yesterday










                              • @JeppeStigNielsen - That works, thanks for the tip!
                                – dana
                                yesterday
















                              5















                              C# (Visual C# Interactive Compiler), 89 bytes





                              Write("Christmas");for(var t=DateTime.Now;$"{t:Md}"!="1225";t=t.AddDays(1))Write(" Eve");


                              Try it online!



                              -3 bytes thanks to @JeppeStigNielsen!



                              My strategy is pretty straightforward:




                              1. Initialize a loop variable t to the current date

                              2. Print Eve if t is not Christmas

                              3. Add a day to t and repeat


                              I tried some fancier things, but this way required the fewest bytes.






                              share|improve this answer























                              • ...do you need to assign t to itself in the incrementor? I don't have the docs in front of me, but if not, you could save two bytes more.
                                – Stackstuck
                                yesterday






                              • 1




                                oh, it's a struct. Of course it is. Nevermind.
                                – Stackstuck
                                yesterday












                              • You can substitute t.Month<12|t.Day!=25 with the shorter $"{t:Md}"!="1225". It uses an interpolated string and a custom DateTime formatting string.
                                – Jeppe Stig Nielsen
                                yesterday










                              • @JeppeStigNielsen - That works, thanks for the tip!
                                – dana
                                yesterday














                              5












                              5








                              5







                              C# (Visual C# Interactive Compiler), 89 bytes





                              Write("Christmas");for(var t=DateTime.Now;$"{t:Md}"!="1225";t=t.AddDays(1))Write(" Eve");


                              Try it online!



                              -3 bytes thanks to @JeppeStigNielsen!



                              My strategy is pretty straightforward:




                              1. Initialize a loop variable t to the current date

                              2. Print Eve if t is not Christmas

                              3. Add a day to t and repeat


                              I tried some fancier things, but this way required the fewest bytes.






                              share|improve this answer















                              C# (Visual C# Interactive Compiler), 89 bytes





                              Write("Christmas");for(var t=DateTime.Now;$"{t:Md}"!="1225";t=t.AddDays(1))Write(" Eve");


                              Try it online!



                              -3 bytes thanks to @JeppeStigNielsen!



                              My strategy is pretty straightforward:




                              1. Initialize a loop variable t to the current date

                              2. Print Eve if t is not Christmas

                              3. Add a day to t and repeat


                              I tried some fancier things, but this way required the fewest bytes.







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited yesterday

























                              answered Dec 25 at 7:52









                              dana

                              42135




                              42135












                              • ...do you need to assign t to itself in the incrementor? I don't have the docs in front of me, but if not, you could save two bytes more.
                                – Stackstuck
                                yesterday






                              • 1




                                oh, it's a struct. Of course it is. Nevermind.
                                – Stackstuck
                                yesterday












                              • You can substitute t.Month<12|t.Day!=25 with the shorter $"{t:Md}"!="1225". It uses an interpolated string and a custom DateTime formatting string.
                                – Jeppe Stig Nielsen
                                yesterday










                              • @JeppeStigNielsen - That works, thanks for the tip!
                                – dana
                                yesterday


















                              • ...do you need to assign t to itself in the incrementor? I don't have the docs in front of me, but if not, you could save two bytes more.
                                – Stackstuck
                                yesterday






                              • 1




                                oh, it's a struct. Of course it is. Nevermind.
                                – Stackstuck
                                yesterday












                              • You can substitute t.Month<12|t.Day!=25 with the shorter $"{t:Md}"!="1225". It uses an interpolated string and a custom DateTime formatting string.
                                – Jeppe Stig Nielsen
                                yesterday










                              • @JeppeStigNielsen - That works, thanks for the tip!
                                – dana
                                yesterday
















                              ...do you need to assign t to itself in the incrementor? I don't have the docs in front of me, but if not, you could save two bytes more.
                              – Stackstuck
                              yesterday




                              ...do you need to assign t to itself in the incrementor? I don't have the docs in front of me, but if not, you could save two bytes more.
                              – Stackstuck
                              yesterday




                              1




                              1




                              oh, it's a struct. Of course it is. Nevermind.
                              – Stackstuck
                              yesterday






                              oh, it's a struct. Of course it is. Nevermind.
                              – Stackstuck
                              yesterday














                              You can substitute t.Month<12|t.Day!=25 with the shorter $"{t:Md}"!="1225". It uses an interpolated string and a custom DateTime formatting string.
                              – Jeppe Stig Nielsen
                              yesterday




                              You can substitute t.Month<12|t.Day!=25 with the shorter $"{t:Md}"!="1225". It uses an interpolated string and a custom DateTime formatting string.
                              – Jeppe Stig Nielsen
                              yesterday












                              @JeppeStigNielsen - That works, thanks for the tip!
                              – dana
                              yesterday




                              @JeppeStigNielsen - That works, thanks for the tip!
                              – dana
                              yesterday











                              4















                              APL (Dyalog Unicode), 76 63 bytesSBCS



                              Full program. Assumes ⎕IO←0 (zero-indexing).



                              ⎕CY'dfns'
                              'Christmas',' Eve'⍴⍨4×12 25⍳⍨⍉2↑1↓⍉date(⍳366)+days⎕TS


                              Try it online!



                              ⎕CY'dfns'copy in the dfns library



                              ⎕TS current time stamp as [year,month,day,hour,min,sec,ms]
                              days[c] find the number of days[n] since 1899-12-31 00:00:00.000
                              (⍳366) add the first 366 integers (0…365) to that
                              date[c] find the dates[n] that correspond to those numbers (366×7 table; one column per unit)
                               transpose (7×366 table; one row per unit)
                              1↓ drop one row (the years)
                              2↑ take the first two rows (months and days)
                              12 25⍳⍨ find the index of the first Christmas
                               multiply that by four
                              ' Eve'⍴⍨ use that to reshape the character list
                              'Christmas ', append that to this



                              [c] code of that function
                              [n] notes for that function






                              share|improve this answer




























                                4















                                APL (Dyalog Unicode), 76 63 bytesSBCS



                                Full program. Assumes ⎕IO←0 (zero-indexing).



                                ⎕CY'dfns'
                                'Christmas',' Eve'⍴⍨4×12 25⍳⍨⍉2↑1↓⍉date(⍳366)+days⎕TS


                                Try it online!



                                ⎕CY'dfns'copy in the dfns library



                                ⎕TS current time stamp as [year,month,day,hour,min,sec,ms]
                                days[c] find the number of days[n] since 1899-12-31 00:00:00.000
                                (⍳366) add the first 366 integers (0…365) to that
                                date[c] find the dates[n] that correspond to those numbers (366×7 table; one column per unit)
                                 transpose (7×366 table; one row per unit)
                                1↓ drop one row (the years)
                                2↑ take the first two rows (months and days)
                                12 25⍳⍨ find the index of the first Christmas
                                 multiply that by four
                                ' Eve'⍴⍨ use that to reshape the character list
                                'Christmas ', append that to this



                                [c] code of that function
                                [n] notes for that function






                                share|improve this answer


























                                  4












                                  4








                                  4







                                  APL (Dyalog Unicode), 76 63 bytesSBCS



                                  Full program. Assumes ⎕IO←0 (zero-indexing).



                                  ⎕CY'dfns'
                                  'Christmas',' Eve'⍴⍨4×12 25⍳⍨⍉2↑1↓⍉date(⍳366)+days⎕TS


                                  Try it online!



                                  ⎕CY'dfns'copy in the dfns library



                                  ⎕TS current time stamp as [year,month,day,hour,min,sec,ms]
                                  days[c] find the number of days[n] since 1899-12-31 00:00:00.000
                                  (⍳366) add the first 366 integers (0…365) to that
                                  date[c] find the dates[n] that correspond to those numbers (366×7 table; one column per unit)
                                   transpose (7×366 table; one row per unit)
                                  1↓ drop one row (the years)
                                  2↑ take the first two rows (months and days)
                                  12 25⍳⍨ find the index of the first Christmas
                                   multiply that by four
                                  ' Eve'⍴⍨ use that to reshape the character list
                                  'Christmas ', append that to this



                                  [c] code of that function
                                  [n] notes for that function






                                  share|improve this answer















                                  APL (Dyalog Unicode), 76 63 bytesSBCS



                                  Full program. Assumes ⎕IO←0 (zero-indexing).



                                  ⎕CY'dfns'
                                  'Christmas',' Eve'⍴⍨4×12 25⍳⍨⍉2↑1↓⍉date(⍳366)+days⎕TS


                                  Try it online!



                                  ⎕CY'dfns'copy in the dfns library



                                  ⎕TS current time stamp as [year,month,day,hour,min,sec,ms]
                                  days[c] find the number of days[n] since 1899-12-31 00:00:00.000
                                  (⍳366) add the first 366 integers (0…365) to that
                                  date[c] find the dates[n] that correspond to those numbers (366×7 table; one column per unit)
                                   transpose (7×366 table; one row per unit)
                                  1↓ drop one row (the years)
                                  2↑ take the first two rows (months and days)
                                  12 25⍳⍨ find the index of the first Christmas
                                   multiply that by four
                                  ' Eve'⍴⍨ use that to reshape the character list
                                  'Christmas ', append that to this



                                  [c] code of that function
                                  [n] notes for that function







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Dec 25 at 9:32

























                                  answered Dec 25 at 8:43









                                  Adám

                                  28.7k269188




                                  28.7k269188























                                      4














                                      PHP, 61 bytes



                                      Christmas<?for($t=time();date(md,$t+=86400)-1226;)echo" Eve";


                                      Run with -n or try it online.






                                      share|improve this answer


























                                        4














                                        PHP, 61 bytes



                                        Christmas<?for($t=time();date(md,$t+=86400)-1226;)echo" Eve";


                                        Run with -n or try it online.






                                        share|improve this answer
























                                          4












                                          4








                                          4






                                          PHP, 61 bytes



                                          Christmas<?for($t=time();date(md,$t+=86400)-1226;)echo" Eve";


                                          Run with -n or try it online.






                                          share|improve this answer












                                          PHP, 61 bytes



                                          Christmas<?for($t=time();date(md,$t+=86400)-1226;)echo" Eve";


                                          Run with -n or try it online.







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Dec 25 at 20:01









                                          Titus

                                          13k11238




                                          13k11238























                                              3















                                              Ruby, 80 bytes





                                              require'date'
                                              t=Date.today
                                              puts'Christmas'+' Eve'*(Date.new((t+6).year,12,25)-t)


                                              Try it online!



                                              Thanks to tsh for his idea






                                              share|improve this answer


























                                                3















                                                Ruby, 80 bytes





                                                require'date'
                                                t=Date.today
                                                puts'Christmas'+' Eve'*(Date.new((t+6).year,12,25)-t)


                                                Try it online!



                                                Thanks to tsh for his idea






                                                share|improve this answer
























                                                  3












                                                  3








                                                  3







                                                  Ruby, 80 bytes





                                                  require'date'
                                                  t=Date.today
                                                  puts'Christmas'+' Eve'*(Date.new((t+6).year,12,25)-t)


                                                  Try it online!



                                                  Thanks to tsh for his idea






                                                  share|improve this answer













                                                  Ruby, 80 bytes





                                                  require'date'
                                                  t=Date.today
                                                  puts'Christmas'+' Eve'*(Date.new((t+6).year,12,25)-t)


                                                  Try it online!



                                                  Thanks to tsh for his idea







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Dec 25 at 13:26









                                                  iBug

                                                  1,357731




                                                  1,357731























                                                      3














                                                      JavaScript, 135 131 121 92 bytes



                                                      My first (naïve) solution (135b):



                                                      t=new Date();n=new Date();n.setMonth(11);n.setDate(25);'Christmas'+' Eve'.repeat((n>=t?n-t:(n.setFullYear(n.getFullYear()+1)-t))/864e5)


                                                      It sets 2 dates: now and Xmas of this year. If the latter hasn't passed yet, it just diffs them, if it has passed, diffs to next year's Xmas. Uses either diffs for the number of repeats.



                                                      (Trying to) Think Outside the Box (131b):



                                                      i=0;f=_=>{t=new Date();if(t.getMonth()!=11||t.getDate()!=25){i++;setTimeout(f,864e5)}else{alert('Christmas'+' Eve'.repeat(i))}};f()


                                                      The challange specifies WHICH output is required when running the program on a given day, but doesn't specify WHEN to return it...



                                                      This will just 'sleep' for a day, increment a counter by 1, and repeat till it's Xmas in order to give the output.



                                                      Since JavaScript doesn't guarantee the 'sleep' time, the actual result might be off.



                                                      It is also ugly for using the alert function, which means wer'e actually not dealing with pure JavaScript, but with browser APIs as well (we can use console.log at the cost of 6 extra bytes).



                                                      A better approach (121b):



                                                      t=new Date();i=0;while(t.getMonth()!=11||t.getDate()!=25){t=new Date(t.valueOf()+864e5);i++};'Christmas'+' Eve'.repeat(i)


                                                      Starting from today, increment the date by a day until it's Xmas, then use that loop's counter for the number of repeats required.



                                                      Improving (including going through a minifier and using 12Me21's trick to shave extra 5b) (92b):



                                                      for(s='Christmas',t=new Date;t.getMonth()/t.getDate()-.44;)t=new Date(t*1+864e5),s+=' Eve';s





                                                      share|improve this answer










                                                      New contributor




                                                      targumon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.














                                                      • 1




                                                        I think you can use t.getMonth()/t.getDate-.48 to check if date is not december 25th
                                                        – 12Me21
                                                        Dec 26 at 0:50










                                                      • Ooh, that's sneaky! In JavaScript it actually should be .44 because the month is zero-based (but the numerator and denominator are still coprime so the fraction is unique and the idea still holds) Thanks!
                                                        – targumon
                                                        Dec 26 at 1:11






                                                      • 1




                                                        Welcome to the site! You can use a 4 space indent to make your code blocks look better.
                                                        – Wît Wisarhd
                                                        Dec 26 at 3:51






                                                      • 1




                                                        Welcome to PPCG!
                                                        – Shaggy
                                                        Dec 26 at 11:47










                                                      • 98, print is needed since this is a program not a function, unless 1. you turn it into a lambda or 2. you state that you're using a REPL
                                                        – ASCII-only
                                                        2 days ago
















                                                      3














                                                      JavaScript, 135 131 121 92 bytes



                                                      My first (naïve) solution (135b):



                                                      t=new Date();n=new Date();n.setMonth(11);n.setDate(25);'Christmas'+' Eve'.repeat((n>=t?n-t:(n.setFullYear(n.getFullYear()+1)-t))/864e5)


                                                      It sets 2 dates: now and Xmas of this year. If the latter hasn't passed yet, it just diffs them, if it has passed, diffs to next year's Xmas. Uses either diffs for the number of repeats.



                                                      (Trying to) Think Outside the Box (131b):



                                                      i=0;f=_=>{t=new Date();if(t.getMonth()!=11||t.getDate()!=25){i++;setTimeout(f,864e5)}else{alert('Christmas'+' Eve'.repeat(i))}};f()


                                                      The challange specifies WHICH output is required when running the program on a given day, but doesn't specify WHEN to return it...



                                                      This will just 'sleep' for a day, increment a counter by 1, and repeat till it's Xmas in order to give the output.



                                                      Since JavaScript doesn't guarantee the 'sleep' time, the actual result might be off.



                                                      It is also ugly for using the alert function, which means wer'e actually not dealing with pure JavaScript, but with browser APIs as well (we can use console.log at the cost of 6 extra bytes).



                                                      A better approach (121b):



                                                      t=new Date();i=0;while(t.getMonth()!=11||t.getDate()!=25){t=new Date(t.valueOf()+864e5);i++};'Christmas'+' Eve'.repeat(i)


                                                      Starting from today, increment the date by a day until it's Xmas, then use that loop's counter for the number of repeats required.



                                                      Improving (including going through a minifier and using 12Me21's trick to shave extra 5b) (92b):



                                                      for(s='Christmas',t=new Date;t.getMonth()/t.getDate()-.44;)t=new Date(t*1+864e5),s+=' Eve';s





                                                      share|improve this answer










                                                      New contributor




                                                      targumon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.














                                                      • 1




                                                        I think you can use t.getMonth()/t.getDate-.48 to check if date is not december 25th
                                                        – 12Me21
                                                        Dec 26 at 0:50










                                                      • Ooh, that's sneaky! In JavaScript it actually should be .44 because the month is zero-based (but the numerator and denominator are still coprime so the fraction is unique and the idea still holds) Thanks!
                                                        – targumon
                                                        Dec 26 at 1:11






                                                      • 1




                                                        Welcome to the site! You can use a 4 space indent to make your code blocks look better.
                                                        – Wît Wisarhd
                                                        Dec 26 at 3:51






                                                      • 1




                                                        Welcome to PPCG!
                                                        – Shaggy
                                                        Dec 26 at 11:47










                                                      • 98, print is needed since this is a program not a function, unless 1. you turn it into a lambda or 2. you state that you're using a REPL
                                                        – ASCII-only
                                                        2 days ago














                                                      3












                                                      3








                                                      3






                                                      JavaScript, 135 131 121 92 bytes



                                                      My first (naïve) solution (135b):



                                                      t=new Date();n=new Date();n.setMonth(11);n.setDate(25);'Christmas'+' Eve'.repeat((n>=t?n-t:(n.setFullYear(n.getFullYear()+1)-t))/864e5)


                                                      It sets 2 dates: now and Xmas of this year. If the latter hasn't passed yet, it just diffs them, if it has passed, diffs to next year's Xmas. Uses either diffs for the number of repeats.



                                                      (Trying to) Think Outside the Box (131b):



                                                      i=0;f=_=>{t=new Date();if(t.getMonth()!=11||t.getDate()!=25){i++;setTimeout(f,864e5)}else{alert('Christmas'+' Eve'.repeat(i))}};f()


                                                      The challange specifies WHICH output is required when running the program on a given day, but doesn't specify WHEN to return it...



                                                      This will just 'sleep' for a day, increment a counter by 1, and repeat till it's Xmas in order to give the output.



                                                      Since JavaScript doesn't guarantee the 'sleep' time, the actual result might be off.



                                                      It is also ugly for using the alert function, which means wer'e actually not dealing with pure JavaScript, but with browser APIs as well (we can use console.log at the cost of 6 extra bytes).



                                                      A better approach (121b):



                                                      t=new Date();i=0;while(t.getMonth()!=11||t.getDate()!=25){t=new Date(t.valueOf()+864e5);i++};'Christmas'+' Eve'.repeat(i)


                                                      Starting from today, increment the date by a day until it's Xmas, then use that loop's counter for the number of repeats required.



                                                      Improving (including going through a minifier and using 12Me21's trick to shave extra 5b) (92b):



                                                      for(s='Christmas',t=new Date;t.getMonth()/t.getDate()-.44;)t=new Date(t*1+864e5),s+=' Eve';s





                                                      share|improve this answer










                                                      New contributor




                                                      targumon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.









                                                      JavaScript, 135 131 121 92 bytes



                                                      My first (naïve) solution (135b):



                                                      t=new Date();n=new Date();n.setMonth(11);n.setDate(25);'Christmas'+' Eve'.repeat((n>=t?n-t:(n.setFullYear(n.getFullYear()+1)-t))/864e5)


                                                      It sets 2 dates: now and Xmas of this year. If the latter hasn't passed yet, it just diffs them, if it has passed, diffs to next year's Xmas. Uses either diffs for the number of repeats.



                                                      (Trying to) Think Outside the Box (131b):



                                                      i=0;f=_=>{t=new Date();if(t.getMonth()!=11||t.getDate()!=25){i++;setTimeout(f,864e5)}else{alert('Christmas'+' Eve'.repeat(i))}};f()


                                                      The challange specifies WHICH output is required when running the program on a given day, but doesn't specify WHEN to return it...



                                                      This will just 'sleep' for a day, increment a counter by 1, and repeat till it's Xmas in order to give the output.



                                                      Since JavaScript doesn't guarantee the 'sleep' time, the actual result might be off.



                                                      It is also ugly for using the alert function, which means wer'e actually not dealing with pure JavaScript, but with browser APIs as well (we can use console.log at the cost of 6 extra bytes).



                                                      A better approach (121b):



                                                      t=new Date();i=0;while(t.getMonth()!=11||t.getDate()!=25){t=new Date(t.valueOf()+864e5);i++};'Christmas'+' Eve'.repeat(i)


                                                      Starting from today, increment the date by a day until it's Xmas, then use that loop's counter for the number of repeats required.



                                                      Improving (including going through a minifier and using 12Me21's trick to shave extra 5b) (92b):



                                                      for(s='Christmas',t=new Date;t.getMonth()/t.getDate()-.44;)t=new Date(t*1+864e5),s+=' Eve';s






                                                      share|improve this answer










                                                      New contributor




                                                      targumon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.









                                                      share|improve this answer



                                                      share|improve this answer








                                                      edited Dec 26 at 6:18





















                                                      New contributor




                                                      targumon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.









                                                      answered Dec 25 at 23:58









                                                      targumon

                                                      1314




                                                      1314




                                                      New contributor




                                                      targumon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.





                                                      New contributor





                                                      targumon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.






                                                      targumon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.








                                                      • 1




                                                        I think you can use t.getMonth()/t.getDate-.48 to check if date is not december 25th
                                                        – 12Me21
                                                        Dec 26 at 0:50










                                                      • Ooh, that's sneaky! In JavaScript it actually should be .44 because the month is zero-based (but the numerator and denominator are still coprime so the fraction is unique and the idea still holds) Thanks!
                                                        – targumon
                                                        Dec 26 at 1:11






                                                      • 1




                                                        Welcome to the site! You can use a 4 space indent to make your code blocks look better.
                                                        – Wît Wisarhd
                                                        Dec 26 at 3:51






                                                      • 1




                                                        Welcome to PPCG!
                                                        – Shaggy
                                                        Dec 26 at 11:47










                                                      • 98, print is needed since this is a program not a function, unless 1. you turn it into a lambda or 2. you state that you're using a REPL
                                                        – ASCII-only
                                                        2 days ago














                                                      • 1




                                                        I think you can use t.getMonth()/t.getDate-.48 to check if date is not december 25th
                                                        – 12Me21
                                                        Dec 26 at 0:50










                                                      • Ooh, that's sneaky! In JavaScript it actually should be .44 because the month is zero-based (but the numerator and denominator are still coprime so the fraction is unique and the idea still holds) Thanks!
                                                        – targumon
                                                        Dec 26 at 1:11






                                                      • 1




                                                        Welcome to the site! You can use a 4 space indent to make your code blocks look better.
                                                        – Wît Wisarhd
                                                        Dec 26 at 3:51






                                                      • 1




                                                        Welcome to PPCG!
                                                        – Shaggy
                                                        Dec 26 at 11:47










                                                      • 98, print is needed since this is a program not a function, unless 1. you turn it into a lambda or 2. you state that you're using a REPL
                                                        – ASCII-only
                                                        2 days ago








                                                      1




                                                      1




                                                      I think you can use t.getMonth()/t.getDate-.48 to check if date is not december 25th
                                                      – 12Me21
                                                      Dec 26 at 0:50




                                                      I think you can use t.getMonth()/t.getDate-.48 to check if date is not december 25th
                                                      – 12Me21
                                                      Dec 26 at 0:50












                                                      Ooh, that's sneaky! In JavaScript it actually should be .44 because the month is zero-based (but the numerator and denominator are still coprime so the fraction is unique and the idea still holds) Thanks!
                                                      – targumon
                                                      Dec 26 at 1:11




                                                      Ooh, that's sneaky! In JavaScript it actually should be .44 because the month is zero-based (but the numerator and denominator are still coprime so the fraction is unique and the idea still holds) Thanks!
                                                      – targumon
                                                      Dec 26 at 1:11




                                                      1




                                                      1




                                                      Welcome to the site! You can use a 4 space indent to make your code blocks look better.
                                                      – Wît Wisarhd
                                                      Dec 26 at 3:51




                                                      Welcome to the site! You can use a 4 space indent to make your code blocks look better.
                                                      – Wît Wisarhd
                                                      Dec 26 at 3:51




                                                      1




                                                      1




                                                      Welcome to PPCG!
                                                      – Shaggy
                                                      Dec 26 at 11:47




                                                      Welcome to PPCG!
                                                      – Shaggy
                                                      Dec 26 at 11:47












                                                      98, print is needed since this is a program not a function, unless 1. you turn it into a lambda or 2. you state that you're using a REPL
                                                      – ASCII-only
                                                      2 days ago




                                                      98, print is needed since this is a program not a function, unless 1. you turn it into a lambda or 2. you state that you're using a REPL
                                                      – ASCII-only
                                                      2 days ago











                                                      3















                                                      Bash, 68 65 bytes





                                                      seq 0 366|sed 's/.*/date -d&day/e;1iChristmas
                                                      /c 25/Q;cEve'|xargs


                                                      Try it online!



                                                      BSD date should be able to save a byte with something like date -v+Ad (can't test it), however, BSD sed would add more bytes to i and c, requiring them to have a <newline>.



                                                      seq 0 366 create a stream of integers from 0 to 366



                                                      |sed perform the following sed code over each line of stream input





                                                      • s substitute



                                                        • .* the pattern space




                                                        • date -d&day with this string, with the match filling the place of &




                                                        • e replace the pattern space with itself evaluated as bash, which computes the date & days from today in the default format of Wed Dec 26 18:22:33 UTC 2018



                                                      • 1 on the first line of input



                                                        • i insert





                                                          • Christmas this string above the line, so being on top of the output




                                                      • /c 25/ if the current line has a c 25 in it, meaning it's Dec 25



                                                        • Q quit the program without printing the pattern space, abruptly stopping any more lines from being read



                                                      • c (otherwise) change the current line to


                                                        • Eve



                                                      |xargs and convert newlines to spaces






                                                      share|improve this answer























                                                      • There's nothing really bash-specific about this solution. It requires GNU date, sed and seq though.
                                                        – Kusalananda
                                                        2 days ago










                                                      • -4 bytes
                                                        – Nahuel Fouilleul
                                                        yesterday


















                                                      3















                                                      Bash, 68 65 bytes





                                                      seq 0 366|sed 's/.*/date -d&day/e;1iChristmas
                                                      /c 25/Q;cEve'|xargs


                                                      Try it online!



                                                      BSD date should be able to save a byte with something like date -v+Ad (can't test it), however, BSD sed would add more bytes to i and c, requiring them to have a <newline>.



                                                      seq 0 366 create a stream of integers from 0 to 366



                                                      |sed perform the following sed code over each line of stream input





                                                      • s substitute



                                                        • .* the pattern space




                                                        • date -d&day with this string, with the match filling the place of &




                                                        • e replace the pattern space with itself evaluated as bash, which computes the date & days from today in the default format of Wed Dec 26 18:22:33 UTC 2018



                                                      • 1 on the first line of input



                                                        • i insert





                                                          • Christmas this string above the line, so being on top of the output




                                                      • /c 25/ if the current line has a c 25 in it, meaning it's Dec 25



                                                        • Q quit the program without printing the pattern space, abruptly stopping any more lines from being read



                                                      • c (otherwise) change the current line to


                                                        • Eve



                                                      |xargs and convert newlines to spaces






                                                      share|improve this answer























                                                      • There's nothing really bash-specific about this solution. It requires GNU date, sed and seq though.
                                                        – Kusalananda
                                                        2 days ago










                                                      • -4 bytes
                                                        – Nahuel Fouilleul
                                                        yesterday
















                                                      3












                                                      3








                                                      3







                                                      Bash, 68 65 bytes





                                                      seq 0 366|sed 's/.*/date -d&day/e;1iChristmas
                                                      /c 25/Q;cEve'|xargs


                                                      Try it online!



                                                      BSD date should be able to save a byte with something like date -v+Ad (can't test it), however, BSD sed would add more bytes to i and c, requiring them to have a <newline>.



                                                      seq 0 366 create a stream of integers from 0 to 366



                                                      |sed perform the following sed code over each line of stream input





                                                      • s substitute



                                                        • .* the pattern space




                                                        • date -d&day with this string, with the match filling the place of &




                                                        • e replace the pattern space with itself evaluated as bash, which computes the date & days from today in the default format of Wed Dec 26 18:22:33 UTC 2018



                                                      • 1 on the first line of input



                                                        • i insert





                                                          • Christmas this string above the line, so being on top of the output




                                                      • /c 25/ if the current line has a c 25 in it, meaning it's Dec 25



                                                        • Q quit the program without printing the pattern space, abruptly stopping any more lines from being read



                                                      • c (otherwise) change the current line to


                                                        • Eve



                                                      |xargs and convert newlines to spaces






                                                      share|improve this answer















                                                      Bash, 68 65 bytes





                                                      seq 0 366|sed 's/.*/date -d&day/e;1iChristmas
                                                      /c 25/Q;cEve'|xargs


                                                      Try it online!



                                                      BSD date should be able to save a byte with something like date -v+Ad (can't test it), however, BSD sed would add more bytes to i and c, requiring them to have a <newline>.



                                                      seq 0 366 create a stream of integers from 0 to 366



                                                      |sed perform the following sed code over each line of stream input





                                                      • s substitute



                                                        • .* the pattern space




                                                        • date -d&day with this string, with the match filling the place of &




                                                        • e replace the pattern space with itself evaluated as bash, which computes the date & days from today in the default format of Wed Dec 26 18:22:33 UTC 2018



                                                      • 1 on the first line of input



                                                        • i insert





                                                          • Christmas this string above the line, so being on top of the output




                                                      • /c 25/ if the current line has a c 25 in it, meaning it's Dec 25



                                                        • Q quit the program without printing the pattern space, abruptly stopping any more lines from being read



                                                      • c (otherwise) change the current line to


                                                        • Eve



                                                      |xargs and convert newlines to spaces







                                                      share|improve this answer














                                                      share|improve this answer



                                                      share|improve this answer








                                                      edited Dec 26 at 19:47

























                                                      answered Dec 26 at 18:38









                                                      Cows quack

                                                      13.7k52777




                                                      13.7k52777












                                                      • There's nothing really bash-specific about this solution. It requires GNU date, sed and seq though.
                                                        – Kusalananda
                                                        2 days ago










                                                      • -4 bytes
                                                        – Nahuel Fouilleul
                                                        yesterday




















                                                      • There's nothing really bash-specific about this solution. It requires GNU date, sed and seq though.
                                                        – Kusalananda
                                                        2 days ago










                                                      • -4 bytes
                                                        – Nahuel Fouilleul
                                                        yesterday


















                                                      There's nothing really bash-specific about this solution. It requires GNU date, sed and seq though.
                                                      – Kusalananda
                                                      2 days ago




                                                      There's nothing really bash-specific about this solution. It requires GNU date, sed and seq though.
                                                      – Kusalananda
                                                      2 days ago












                                                      -4 bytes
                                                      – Nahuel Fouilleul
                                                      yesterday






                                                      -4 bytes
                                                      – Nahuel Fouilleul
                                                      yesterday













                                                      3














                                                      VBA (Excel), 108 bytes



                                                      Copy in a blank module. Prints to the Immediate window:



                                                      Sub X:s="Christmas":d=Now:For t=1 To (DateSerial(Year(d+6),12,25)-d):s=s &" Eve":Next:Debug.Print s:End Sub


                                                      Note: Using : instead of line breaks saves two bytes per line.



                                                      Notice that the VBA editor will insert additional spaces between keywords, operators, etc... and parenthesis after the Sub definition, but if you copy and paste this code it will work (I couldn't get rid of that space before the &).



                                                      Not bad for VBA (for once).






                                                      share|improve this answer










                                                      New contributor




                                                      Barranka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.














                                                      • 1




                                                        *Christmas :|
                                                        – ASCII-only
                                                        Dec 26 at 23:47












                                                      • @ASCII-only: removing the space before the & throws an error
                                                        – Barranka
                                                        Dec 26 at 23:49










                                                      • -1 bytes. Thanks to @ASCII-only for catching the typo
                                                        – Barranka
                                                        Dec 27 at 0:06
















                                                      3














                                                      VBA (Excel), 108 bytes



                                                      Copy in a blank module. Prints to the Immediate window:



                                                      Sub X:s="Christmas":d=Now:For t=1 To (DateSerial(Year(d+6),12,25)-d):s=s &" Eve":Next:Debug.Print s:End Sub


                                                      Note: Using : instead of line breaks saves two bytes per line.



                                                      Notice that the VBA editor will insert additional spaces between keywords, operators, etc... and parenthesis after the Sub definition, but if you copy and paste this code it will work (I couldn't get rid of that space before the &).



                                                      Not bad for VBA (for once).






                                                      share|improve this answer










                                                      New contributor




                                                      Barranka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.














                                                      • 1




                                                        *Christmas :|
                                                        – ASCII-only
                                                        Dec 26 at 23:47












                                                      • @ASCII-only: removing the space before the & throws an error
                                                        – Barranka
                                                        Dec 26 at 23:49










                                                      • -1 bytes. Thanks to @ASCII-only for catching the typo
                                                        – Barranka
                                                        Dec 27 at 0:06














                                                      3












                                                      3








                                                      3






                                                      VBA (Excel), 108 bytes



                                                      Copy in a blank module. Prints to the Immediate window:



                                                      Sub X:s="Christmas":d=Now:For t=1 To (DateSerial(Year(d+6),12,25)-d):s=s &" Eve":Next:Debug.Print s:End Sub


                                                      Note: Using : instead of line breaks saves two bytes per line.



                                                      Notice that the VBA editor will insert additional spaces between keywords, operators, etc... and parenthesis after the Sub definition, but if you copy and paste this code it will work (I couldn't get rid of that space before the &).



                                                      Not bad for VBA (for once).






                                                      share|improve this answer










                                                      New contributor




                                                      Barranka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.









                                                      VBA (Excel), 108 bytes



                                                      Copy in a blank module. Prints to the Immediate window:



                                                      Sub X:s="Christmas":d=Now:For t=1 To (DateSerial(Year(d+6),12,25)-d):s=s &" Eve":Next:Debug.Print s:End Sub


                                                      Note: Using : instead of line breaks saves two bytes per line.



                                                      Notice that the VBA editor will insert additional spaces between keywords, operators, etc... and parenthesis after the Sub definition, but if you copy and paste this code it will work (I couldn't get rid of that space before the &).



                                                      Not bad for VBA (for once).







                                                      share|improve this answer










                                                      New contributor




                                                      Barranka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.









                                                      share|improve this answer



                                                      share|improve this answer








                                                      edited Dec 27 at 0:06





















                                                      New contributor




                                                      Barranka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.









                                                      answered Dec 26 at 23:45









                                                      Barranka

                                                      1316




                                                      1316




                                                      New contributor




                                                      Barranka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.





                                                      New contributor





                                                      Barranka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.






                                                      Barranka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.








                                                      • 1




                                                        *Christmas :|
                                                        – ASCII-only
                                                        Dec 26 at 23:47












                                                      • @ASCII-only: removing the space before the & throws an error
                                                        – Barranka
                                                        Dec 26 at 23:49










                                                      • -1 bytes. Thanks to @ASCII-only for catching the typo
                                                        – Barranka
                                                        Dec 27 at 0:06














                                                      • 1




                                                        *Christmas :|
                                                        – ASCII-only
                                                        Dec 26 at 23:47












                                                      • @ASCII-only: removing the space before the & throws an error
                                                        – Barranka
                                                        Dec 26 at 23:49










                                                      • -1 bytes. Thanks to @ASCII-only for catching the typo
                                                        – Barranka
                                                        Dec 27 at 0:06








                                                      1




                                                      1




                                                      *Christmas :|
                                                      – ASCII-only
                                                      Dec 26 at 23:47






                                                      *Christmas :|
                                                      – ASCII-only
                                                      Dec 26 at 23:47














                                                      @ASCII-only: removing the space before the & throws an error
                                                      – Barranka
                                                      Dec 26 at 23:49




                                                      @ASCII-only: removing the space before the & throws an error
                                                      – Barranka
                                                      Dec 26 at 23:49












                                                      -1 bytes. Thanks to @ASCII-only for catching the typo
                                                      – Barranka
                                                      Dec 27 at 0:06




                                                      -1 bytes. Thanks to @ASCII-only for catching the typo
                                                      – Barranka
                                                      Dec 27 at 0:06











                                                      3















                                                      Python 2, 111 103 bytes





                                                      from datetime import*
                                                      d=date.today()
                                                      print"Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days


                                                      Try it online!



                                                      Update inspired by Richard Crossley's answer.



                                                      Explanation:



                                                      from datetime import*
                                                      # get today as a date, so we don't have to worry about rounding errors due to time
                                                      d=date.today()
                                                      # get the year of the Christmas to compare to
                                                      # if the current date is after this year's Christmas, the 6 day offset will give the next year
                                                      # otherwise, returns this year
                                                      (d+timedelta(6)).year
                                                      # next Christmas minus the current date
                                                      date(.....................,12,25)-d
                                                      # Christmas, plus (number of days until next Christmas) " Eve"s
                                                      print"Christmas"+" Eve"*(...................................).days





                                                      share|improve this answer




























                                                        3















                                                        Python 2, 111 103 bytes





                                                        from datetime import*
                                                        d=date.today()
                                                        print"Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days


                                                        Try it online!



                                                        Update inspired by Richard Crossley's answer.



                                                        Explanation:



                                                        from datetime import*
                                                        # get today as a date, so we don't have to worry about rounding errors due to time
                                                        d=date.today()
                                                        # get the year of the Christmas to compare to
                                                        # if the current date is after this year's Christmas, the 6 day offset will give the next year
                                                        # otherwise, returns this year
                                                        (d+timedelta(6)).year
                                                        # next Christmas minus the current date
                                                        date(.....................,12,25)-d
                                                        # Christmas, plus (number of days until next Christmas) " Eve"s
                                                        print"Christmas"+" Eve"*(...................................).days





                                                        share|improve this answer


























                                                          3












                                                          3








                                                          3







                                                          Python 2, 111 103 bytes





                                                          from datetime import*
                                                          d=date.today()
                                                          print"Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days


                                                          Try it online!



                                                          Update inspired by Richard Crossley's answer.



                                                          Explanation:



                                                          from datetime import*
                                                          # get today as a date, so we don't have to worry about rounding errors due to time
                                                          d=date.today()
                                                          # get the year of the Christmas to compare to
                                                          # if the current date is after this year's Christmas, the 6 day offset will give the next year
                                                          # otherwise, returns this year
                                                          (d+timedelta(6)).year
                                                          # next Christmas minus the current date
                                                          date(.....................,12,25)-d
                                                          # Christmas, plus (number of days until next Christmas) " Eve"s
                                                          print"Christmas"+" Eve"*(...................................).days





                                                          share|improve this answer















                                                          Python 2, 111 103 bytes





                                                          from datetime import*
                                                          d=date.today()
                                                          print"Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days


                                                          Try it online!



                                                          Update inspired by Richard Crossley's answer.



                                                          Explanation:



                                                          from datetime import*
                                                          # get today as a date, so we don't have to worry about rounding errors due to time
                                                          d=date.today()
                                                          # get the year of the Christmas to compare to
                                                          # if the current date is after this year's Christmas, the 6 day offset will give the next year
                                                          # otherwise, returns this year
                                                          (d+timedelta(6)).year
                                                          # next Christmas minus the current date
                                                          date(.....................,12,25)-d
                                                          # Christmas, plus (number of days until next Christmas) " Eve"s
                                                          print"Christmas"+" Eve"*(...................................).days






                                                          share|improve this answer














                                                          share|improve this answer



                                                          share|improve this answer








                                                          edited 2 days ago

























                                                          answered Dec 26 at 21:12









                                                          Triggernometry

                                                          54617




                                                          54617























                                                              3














                                                              Bash +GNU date, 72 73 bytes



                                                              for((d=0;1`date +%d%m -d$dday`-12512;d++));{ x+= Eve;};echo Christmas$x



                                                              • one byte saved replacing != with -

                                                              • another removing extra space

                                                              • fix -3 bytes d=0, because date -dday is date+1 and doesn't work on 25/12


                                                              Try it online






                                                              share|improve this answer























                                                              • Hmmm, why does =~ not work in the for-loop conditional?
                                                                – Cows quack
                                                                Dec 26 at 19:14










                                                              • because the for loop condition is an arithmetic expression, words are coerced to integer also number starting with 0 are assumed in octal, that's why 1 is prepended
                                                                – Nahuel Fouilleul
                                                                2 days ago


















                                                              3














                                                              Bash +GNU date, 72 73 bytes



                                                              for((d=0;1`date +%d%m -d$dday`-12512;d++));{ x+= Eve;};echo Christmas$x



                                                              • one byte saved replacing != with -

                                                              • another removing extra space

                                                              • fix -3 bytes d=0, because date -dday is date+1 and doesn't work on 25/12


                                                              Try it online






                                                              share|improve this answer























                                                              • Hmmm, why does =~ not work in the for-loop conditional?
                                                                – Cows quack
                                                                Dec 26 at 19:14










                                                              • because the for loop condition is an arithmetic expression, words are coerced to integer also number starting with 0 are assumed in octal, that's why 1 is prepended
                                                                – Nahuel Fouilleul
                                                                2 days ago
















                                                              3












                                                              3








                                                              3






                                                              Bash +GNU date, 72 73 bytes



                                                              for((d=0;1`date +%d%m -d$dday`-12512;d++));{ x+= Eve;};echo Christmas$x



                                                              • one byte saved replacing != with -

                                                              • another removing extra space

                                                              • fix -3 bytes d=0, because date -dday is date+1 and doesn't work on 25/12


                                                              Try it online






                                                              share|improve this answer














                                                              Bash +GNU date, 72 73 bytes



                                                              for((d=0;1`date +%d%m -d$dday`-12512;d++));{ x+= Eve;};echo Christmas$x



                                                              • one byte saved replacing != with -

                                                              • another removing extra space

                                                              • fix -3 bytes d=0, because date -dday is date+1 and doesn't work on 25/12


                                                              Try it online







                                                              share|improve this answer














                                                              share|improve this answer



                                                              share|improve this answer








                                                              edited yesterday

























                                                              answered Dec 26 at 14:46









                                                              Nahuel Fouilleul

                                                              1,60228




                                                              1,60228












                                                              • Hmmm, why does =~ not work in the for-loop conditional?
                                                                – Cows quack
                                                                Dec 26 at 19:14










                                                              • because the for loop condition is an arithmetic expression, words are coerced to integer also number starting with 0 are assumed in octal, that's why 1 is prepended
                                                                – Nahuel Fouilleul
                                                                2 days ago




















                                                              • Hmmm, why does =~ not work in the for-loop conditional?
                                                                – Cows quack
                                                                Dec 26 at 19:14










                                                              • because the for loop condition is an arithmetic expression, words are coerced to integer also number starting with 0 are assumed in octal, that's why 1 is prepended
                                                                – Nahuel Fouilleul
                                                                2 days ago


















                                                              Hmmm, why does =~ not work in the for-loop conditional?
                                                              – Cows quack
                                                              Dec 26 at 19:14




                                                              Hmmm, why does =~ not work in the for-loop conditional?
                                                              – Cows quack
                                                              Dec 26 at 19:14












                                                              because the for loop condition is an arithmetic expression, words are coerced to integer also number starting with 0 are assumed in octal, that's why 1 is prepended
                                                              – Nahuel Fouilleul
                                                              2 days ago






                                                              because the for loop condition is an arithmetic expression, words are coerced to integer also number starting with 0 are assumed in octal, that's why 1 is prepended
                                                              – Nahuel Fouilleul
                                                              2 days ago













                                                              3














                                                              Python 2, 128 bytes / Python 3, 130 bytes



                                                              of course, two less bytes with Python 2



                                                              from datetime import date as D
                                                              T=D.today()
                                                              Y=T.year
                                                              a=(D(Y,12,25)-T).days
                                                              print("Christmas"+" Eve"*[a,(D(Y+1,12,25)-T).days][a<0])





                                                              share|improve this answer



















                                                              • 1




                                                                105 bytes
                                                                – tsh
                                                                Dec 25 at 13:00










                                                              • @tsh That's an amazing approach!
                                                                – iBug
                                                                Dec 25 at 13:18






                                                              • 1




                                                                Python 2 doesn't need a space after print so it's 128 bytes
                                                                – NieDzejkob
                                                                yesterday






                                                              • 3




                                                                -2 bytes by implementing as D by yourself
                                                                – NieDzejkob
                                                                yesterday
















                                                              3














                                                              Python 2, 128 bytes / Python 3, 130 bytes



                                                              of course, two less bytes with Python 2



                                                              from datetime import date as D
                                                              T=D.today()
                                                              Y=T.year
                                                              a=(D(Y,12,25)-T).days
                                                              print("Christmas"+" Eve"*[a,(D(Y+1,12,25)-T).days][a<0])





                                                              share|improve this answer



















                                                              • 1




                                                                105 bytes
                                                                – tsh
                                                                Dec 25 at 13:00










                                                              • @tsh That's an amazing approach!
                                                                – iBug
                                                                Dec 25 at 13:18






                                                              • 1




                                                                Python 2 doesn't need a space after print so it's 128 bytes
                                                                – NieDzejkob
                                                                yesterday






                                                              • 3




                                                                -2 bytes by implementing as D by yourself
                                                                – NieDzejkob
                                                                yesterday














                                                              3












                                                              3








                                                              3






                                                              Python 2, 128 bytes / Python 3, 130 bytes



                                                              of course, two less bytes with Python 2



                                                              from datetime import date as D
                                                              T=D.today()
                                                              Y=T.year
                                                              a=(D(Y,12,25)-T).days
                                                              print("Christmas"+" Eve"*[a,(D(Y+1,12,25)-T).days][a<0])





                                                              share|improve this answer














                                                              Python 2, 128 bytes / Python 3, 130 bytes



                                                              of course, two less bytes with Python 2



                                                              from datetime import date as D
                                                              T=D.today()
                                                              Y=T.year
                                                              a=(D(Y,12,25)-T).days
                                                              print("Christmas"+" Eve"*[a,(D(Y+1,12,25)-T).days][a<0])






                                                              share|improve this answer














                                                              share|improve this answer



                                                              share|improve this answer








                                                              edited yesterday

























                                                              answered Dec 25 at 5:42









                                                              iBug

                                                              1,357731




                                                              1,357731








                                                              • 1




                                                                105 bytes
                                                                – tsh
                                                                Dec 25 at 13:00










                                                              • @tsh That's an amazing approach!
                                                                – iBug
                                                                Dec 25 at 13:18






                                                              • 1




                                                                Python 2 doesn't need a space after print so it's 128 bytes
                                                                – NieDzejkob
                                                                yesterday






                                                              • 3




                                                                -2 bytes by implementing as D by yourself
                                                                – NieDzejkob
                                                                yesterday














                                                              • 1




                                                                105 bytes
                                                                – tsh
                                                                Dec 25 at 13:00










                                                              • @tsh That's an amazing approach!
                                                                – iBug
                                                                Dec 25 at 13:18






                                                              • 1




                                                                Python 2 doesn't need a space after print so it's 128 bytes
                                                                – NieDzejkob
                                                                yesterday






                                                              • 3




                                                                -2 bytes by implementing as D by yourself
                                                                – NieDzejkob
                                                                yesterday








                                                              1




                                                              1




                                                              105 bytes
                                                              – tsh
                                                              Dec 25 at 13:00




                                                              105 bytes
                                                              – tsh
                                                              Dec 25 at 13:00












                                                              @tsh That's an amazing approach!
                                                              – iBug
                                                              Dec 25 at 13:18




                                                              @tsh That's an amazing approach!
                                                              – iBug
                                                              Dec 25 at 13:18




                                                              1




                                                              1




                                                              Python 2 doesn't need a space after print so it's 128 bytes
                                                              – NieDzejkob
                                                              yesterday




                                                              Python 2 doesn't need a space after print so it's 128 bytes
                                                              – NieDzejkob
                                                              yesterday




                                                              3




                                                              3




                                                              -2 bytes by implementing as D by yourself
                                                              – NieDzejkob
                                                              yesterday




                                                              -2 bytes by implementing as D by yourself
                                                              – NieDzejkob
                                                              yesterday











                                                              2















                                                              C (gcc), 157 bytes



                                                              I thought that I would be able to avoid including time.h but that just gave segment faults.





                                                              #include <time.h>
                                                              *t,u;f(){time(&u);t=localtime(&u);t[5]+=t[4]>10&t[3]>25;t[4]=11;t[3]=25;u-=mktime(t);printf("Christmas");for(u/=86400;u++;printf(" Eve"));}


                                                              Try it online!






                                                              share|improve this answer























                                                              • IMO you should leave out the #include <stdlib.h>, not like it does anything at all here
                                                                – ASCII-only
                                                                Dec 26 at 9:02










                                                              • Suggest *t;f(u) instead of *t,u;f() and #import<time.h> instead of #include <time.h> and 5[t=localtime(&u)] instead of t=localtime(&u);t[5]
                                                                – ceilingcat
                                                                yesterday
















                                                              2















                                                              C (gcc), 157 bytes



                                                              I thought that I would be able to avoid including time.h but that just gave segment faults.





                                                              #include <time.h>
                                                              *t,u;f(){time(&u);t=localtime(&u);t[5]+=t[4]>10&t[3]>25;t[4]=11;t[3]=25;u-=mktime(t);printf("Christmas");for(u/=86400;u++;printf(" Eve"));}


                                                              Try it online!






                                                              share|improve this answer























                                                              • IMO you should leave out the #include <stdlib.h>, not like it does anything at all here
                                                                – ASCII-only
                                                                Dec 26 at 9:02










                                                              • Suggest *t;f(u) instead of *t,u;f() and #import<time.h> instead of #include <time.h> and 5[t=localtime(&u)] instead of t=localtime(&u);t[5]
                                                                – ceilingcat
                                                                yesterday














                                                              2












                                                              2








                                                              2







                                                              C (gcc), 157 bytes



                                                              I thought that I would be able to avoid including time.h but that just gave segment faults.





                                                              #include <time.h>
                                                              *t,u;f(){time(&u);t=localtime(&u);t[5]+=t[4]>10&t[3]>25;t[4]=11;t[3]=25;u-=mktime(t);printf("Christmas");for(u/=86400;u++;printf(" Eve"));}


                                                              Try it online!






                                                              share|improve this answer















                                                              C (gcc), 157 bytes



                                                              I thought that I would be able to avoid including time.h but that just gave segment faults.





                                                              #include <time.h>
                                                              *t,u;f(){time(&u);t=localtime(&u);t[5]+=t[4]>10&t[3]>25;t[4]=11;t[3]=25;u-=mktime(t);printf("Christmas");for(u/=86400;u++;printf(" Eve"));}


                                                              Try it online!







                                                              share|improve this answer














                                                              share|improve this answer



                                                              share|improve this answer








                                                              edited Dec 26 at 7:58

























                                                              answered Dec 26 at 0:51









                                                              ErikF

                                                              1,27917




                                                              1,27917












                                                              • IMO you should leave out the #include <stdlib.h>, not like it does anything at all here
                                                                – ASCII-only
                                                                Dec 26 at 9:02










                                                              • Suggest *t;f(u) instead of *t,u;f() and #import<time.h> instead of #include <time.h> and 5[t=localtime(&u)] instead of t=localtime(&u);t[5]
                                                                – ceilingcat
                                                                yesterday


















                                                              • IMO you should leave out the #include <stdlib.h>, not like it does anything at all here
                                                                – ASCII-only
                                                                Dec 26 at 9:02










                                                              • Suggest *t;f(u) instead of *t,u;f() and #import<time.h> instead of #include <time.h> and 5[t=localtime(&u)] instead of t=localtime(&u);t[5]
                                                                – ceilingcat
                                                                yesterday
















                                                              IMO you should leave out the #include <stdlib.h>, not like it does anything at all here
                                                              – ASCII-only
                                                              Dec 26 at 9:02




                                                              IMO you should leave out the #include <stdlib.h>, not like it does anything at all here
                                                              – ASCII-only
                                                              Dec 26 at 9:02












                                                              Suggest *t;f(u) instead of *t,u;f() and #import<time.h> instead of #include <time.h> and 5[t=localtime(&u)] instead of t=localtime(&u);t[5]
                                                              – ceilingcat
                                                              yesterday




                                                              Suggest *t;f(u) instead of *t,u;f() and #import<time.h> instead of #include <time.h> and 5[t=localtime(&u)] instead of t=localtime(&u);t[5]
                                                              – ceilingcat
                                                              yesterday











                                                              2















                                                              Groovy, 66 bytes



                                                              d=as Date
                                                              print'Christmas'+' Eve'*(new Date((d+6).year,11,25)-d)


                                                              Try it online!



                                                              Courtesy of @ASCII-only






                                                              share|improve this answer










                                                              New contributor




                                                              bdkosher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                              Check out our Code of Conduct.


















                                                              • You need to print it out since this is a full program not a function
                                                                – ASCII-only
                                                                2 days ago












                                                              • > Chistmas :/
                                                                – ASCII-only
                                                                2 days ago










                                                              • fixed, 149
                                                                – ASCII-only
                                                                2 days ago










                                                              • 123
                                                                – ASCII-only
                                                                2 days ago












                                                              • taking your first one and using Groovy 2.5 slims it down to 115.
                                                                – bdkosher
                                                                2 days ago
















                                                              2















                                                              Groovy, 66 bytes



                                                              d=as Date
                                                              print'Christmas'+' Eve'*(new Date((d+6).year,11,25)-d)


                                                              Try it online!



                                                              Courtesy of @ASCII-only






                                                              share|improve this answer










                                                              New contributor




                                                              bdkosher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                              Check out our Code of Conduct.


















                                                              • You need to print it out since this is a full program not a function
                                                                – ASCII-only
                                                                2 days ago












                                                              • > Chistmas :/
                                                                – ASCII-only
                                                                2 days ago










                                                              • fixed, 149
                                                                – ASCII-only
                                                                2 days ago










                                                              • 123
                                                                – ASCII-only
                                                                2 days ago












                                                              • taking your first one and using Groovy 2.5 slims it down to 115.
                                                                – bdkosher
                                                                2 days ago














                                                              2












                                                              2








                                                              2







                                                              Groovy, 66 bytes



                                                              d=as Date
                                                              print'Christmas'+' Eve'*(new Date((d+6).year,11,25)-d)


                                                              Try it online!



                                                              Courtesy of @ASCII-only






                                                              share|improve this answer










                                                              New contributor




                                                              bdkosher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                              Check out our Code of Conduct.










                                                              Groovy, 66 bytes



                                                              d=as Date
                                                              print'Christmas'+' Eve'*(new Date((d+6).year,11,25)-d)


                                                              Try it online!



                                                              Courtesy of @ASCII-only







                                                              share|improve this answer










                                                              New contributor




                                                              bdkosher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                              Check out our Code of Conduct.









                                                              share|improve this answer



                                                              share|improve this answer








                                                              edited 2 days ago





















                                                              New contributor




                                                              bdkosher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                              Check out our Code of Conduct.









                                                              answered Dec 25 at 14:58









                                                              bdkosher

                                                              1213




                                                              1213




                                                              New contributor




                                                              bdkosher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                              Check out our Code of Conduct.





                                                              New contributor





                                                              bdkosher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                              Check out our Code of Conduct.






                                                              bdkosher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                              Check out our Code of Conduct.












                                                              • You need to print it out since this is a full program not a function
                                                                – ASCII-only
                                                                2 days ago












                                                              • > Chistmas :/
                                                                – ASCII-only
                                                                2 days ago










                                                              • fixed, 149
                                                                – ASCII-only
                                                                2 days ago










                                                              • 123
                                                                – ASCII-only
                                                                2 days ago












                                                              • taking your first one and using Groovy 2.5 slims it down to 115.
                                                                – bdkosher
                                                                2 days ago


















                                                              • You need to print it out since this is a full program not a function
                                                                – ASCII-only
                                                                2 days ago












                                                              • > Chistmas :/
                                                                – ASCII-only
                                                                2 days ago










                                                              • fixed, 149
                                                                – ASCII-only
                                                                2 days ago










                                                              • 123
                                                                – ASCII-only
                                                                2 days ago












                                                              • taking your first one and using Groovy 2.5 slims it down to 115.
                                                                – bdkosher
                                                                2 days ago
















                                                              You need to print it out since this is a full program not a function
                                                              – ASCII-only
                                                              2 days ago






                                                              You need to print it out since this is a full program not a function
                                                              – ASCII-only
                                                              2 days ago














                                                              > Chistmas :/
                                                              – ASCII-only
                                                              2 days ago




                                                              > Chistmas :/
                                                              – ASCII-only
                                                              2 days ago












                                                              fixed, 149
                                                              – ASCII-only
                                                              2 days ago




                                                              fixed, 149
                                                              – ASCII-only
                                                              2 days ago












                                                              123
                                                              – ASCII-only
                                                              2 days ago






                                                              123
                                                              – ASCII-only
                                                              2 days ago














                                                              taking your first one and using Groovy 2.5 slims it down to 115.
                                                              – bdkosher
                                                              2 days ago




                                                              taking your first one and using Groovy 2.5 slims it down to 115.
                                                              – bdkosher
                                                              2 days ago











                                                              1














                                                              MySQL, 102 bytes



                                                              pretty much the same as Neil´s T-SQL answer. There seems to be no shorter way in SQL.



                                                              select concat("Christmas",repeat(" Eve",datediff(concat(year(now()+interval 6 day),"-12-25"),now())));


                                                              Try it online.






                                                              share|improve this answer


























                                                                1














                                                                MySQL, 102 bytes



                                                                pretty much the same as Neil´s T-SQL answer. There seems to be no shorter way in SQL.



                                                                select concat("Christmas",repeat(" Eve",datediff(concat(year(now()+interval 6 day),"-12-25"),now())));


                                                                Try it online.






                                                                share|improve this answer
























                                                                  1












                                                                  1








                                                                  1






                                                                  MySQL, 102 bytes



                                                                  pretty much the same as Neil´s T-SQL answer. There seems to be no shorter way in SQL.



                                                                  select concat("Christmas",repeat(" Eve",datediff(concat(year(now()+interval 6 day),"-12-25"),now())));


                                                                  Try it online.






                                                                  share|improve this answer












                                                                  MySQL, 102 bytes



                                                                  pretty much the same as Neil´s T-SQL answer. There seems to be no shorter way in SQL.



                                                                  select concat("Christmas",repeat(" Eve",datediff(concat(year(now()+interval 6 day),"-12-25"),now())));


                                                                  Try it online.







                                                                  share|improve this answer












                                                                  share|improve this answer



                                                                  share|improve this answer










                                                                  answered Dec 25 at 20:55









                                                                  Titus

                                                                  13k11238




                                                                  13k11238























                                                                      1















                                                                      Scala, 140 bytes





                                                                      import org.joda.time._
                                                                      var s="Christmas"
                                                                      var d=DateTime.now
                                                                      while(d!=d.withDate(d.year().get(),12,25)){d=d.plusDays(1);s+=" Eve"};println(s)


                                                                      Does not run in TIO since it requires Joda-Time library.






                                                                      share|improve this answer





















                                                                      • no joda, 154. sadly can't get java.util.Date to work here :/
                                                                        – ASCII-only
                                                                        2 days ago












                                                                      • 148
                                                                        – ASCII-only
                                                                        2 days ago










                                                                      • Ah @ASCII-only I did not count object Main extends App{} chars in my counting (cause I didn't in my other Scala answers either). If we take that out you beat me ^^
                                                                        – V. Courtois
                                                                        yesterday










                                                                      • The withDate() call is so expensive...
                                                                        – V. Courtois
                                                                        yesterday
















                                                                      1















                                                                      Scala, 140 bytes





                                                                      import org.joda.time._
                                                                      var s="Christmas"
                                                                      var d=DateTime.now
                                                                      while(d!=d.withDate(d.year().get(),12,25)){d=d.plusDays(1);s+=" Eve"};println(s)


                                                                      Does not run in TIO since it requires Joda-Time library.






                                                                      share|improve this answer





















                                                                      • no joda, 154. sadly can't get java.util.Date to work here :/
                                                                        – ASCII-only
                                                                        2 days ago












                                                                      • 148
                                                                        – ASCII-only
                                                                        2 days ago










                                                                      • Ah @ASCII-only I did not count object Main extends App{} chars in my counting (cause I didn't in my other Scala answers either). If we take that out you beat me ^^
                                                                        – V. Courtois
                                                                        yesterday










                                                                      • The withDate() call is so expensive...
                                                                        – V. Courtois
                                                                        yesterday














                                                                      1












                                                                      1








                                                                      1







                                                                      Scala, 140 bytes





                                                                      import org.joda.time._
                                                                      var s="Christmas"
                                                                      var d=DateTime.now
                                                                      while(d!=d.withDate(d.year().get(),12,25)){d=d.plusDays(1);s+=" Eve"};println(s)


                                                                      Does not run in TIO since it requires Joda-Time library.






                                                                      share|improve this answer













                                                                      Scala, 140 bytes





                                                                      import org.joda.time._
                                                                      var s="Christmas"
                                                                      var d=DateTime.now
                                                                      while(d!=d.withDate(d.year().get(),12,25)){d=d.plusDays(1);s+=" Eve"};println(s)


                                                                      Does not run in TIO since it requires Joda-Time library.







                                                                      share|improve this answer












                                                                      share|improve this answer



                                                                      share|improve this answer










                                                                      answered 2 days ago









                                                                      V. Courtois

                                                                      708113




                                                                      708113












                                                                      • no joda, 154. sadly can't get java.util.Date to work here :/
                                                                        – ASCII-only
                                                                        2 days ago












                                                                      • 148
                                                                        – ASCII-only
                                                                        2 days ago










                                                                      • Ah @ASCII-only I did not count object Main extends App{} chars in my counting (cause I didn't in my other Scala answers either). If we take that out you beat me ^^
                                                                        – V. Courtois
                                                                        yesterday










                                                                      • The withDate() call is so expensive...
                                                                        – V. Courtois
                                                                        yesterday


















                                                                      • no joda, 154. sadly can't get java.util.Date to work here :/
                                                                        – ASCII-only
                                                                        2 days ago












                                                                      • 148
                                                                        – ASCII-only
                                                                        2 days ago










                                                                      • Ah @ASCII-only I did not count object Main extends App{} chars in my counting (cause I didn't in my other Scala answers either). If we take that out you beat me ^^
                                                                        – V. Courtois
                                                                        yesterday










                                                                      • The withDate() call is so expensive...
                                                                        – V. Courtois
                                                                        yesterday
















                                                                      no joda, 154. sadly can't get java.util.Date to work here :/
                                                                      – ASCII-only
                                                                      2 days ago






                                                                      no joda, 154. sadly can't get java.util.Date to work here :/
                                                                      – ASCII-only
                                                                      2 days ago














                                                                      148
                                                                      – ASCII-only
                                                                      2 days ago




                                                                      148
                                                                      – ASCII-only
                                                                      2 days ago












                                                                      Ah @ASCII-only I did not count object Main extends App{} chars in my counting (cause I didn't in my other Scala answers either). If we take that out you beat me ^^
                                                                      – V. Courtois
                                                                      yesterday




                                                                      Ah @ASCII-only I did not count object Main extends App{} chars in my counting (cause I didn't in my other Scala answers either). If we take that out you beat me ^^
                                                                      – V. Courtois
                                                                      yesterday












                                                                      The withDate() call is so expensive...
                                                                      – V. Courtois
                                                                      yesterday




                                                                      The withDate() call is so expensive...
                                                                      – V. Courtois
                                                                      yesterday











                                                                      1














                                                                      Java 8, 161 146 Bytes



                                                                      void t(){LocalDate a=LocalDate.now();
                                                                      String b="Christmas";
                                                                      while(!a.toString().endsWith("12-25")){b+=" Eve";a=a.plusDays(1);}
                                                                      System.out.print(b)}}





                                                                      share|improve this answer























                                                                      • You need to include imports in the bytecount (and since you need to import, this needs to be a full program)
                                                                        – ASCII-only
                                                                        2 days ago












                                                                      • You can save 6 bytes by changing a.toString() into (""+a).
                                                                        – Christopher Schultz
                                                                        yesterday
















                                                                      1














                                                                      Java 8, 161 146 Bytes



                                                                      void t(){LocalDate a=LocalDate.now();
                                                                      String b="Christmas";
                                                                      while(!a.toString().endsWith("12-25")){b+=" Eve";a=a.plusDays(1);}
                                                                      System.out.print(b)}}





                                                                      share|improve this answer























                                                                      • You need to include imports in the bytecount (and since you need to import, this needs to be a full program)
                                                                        – ASCII-only
                                                                        2 days ago












                                                                      • You can save 6 bytes by changing a.toString() into (""+a).
                                                                        – Christopher Schultz
                                                                        yesterday














                                                                      1












                                                                      1








                                                                      1






                                                                      Java 8, 161 146 Bytes



                                                                      void t(){LocalDate a=LocalDate.now();
                                                                      String b="Christmas";
                                                                      while(!a.toString().endsWith("12-25")){b+=" Eve";a=a.plusDays(1);}
                                                                      System.out.print(b)}}





                                                                      share|improve this answer














                                                                      Java 8, 161 146 Bytes



                                                                      void t(){LocalDate a=LocalDate.now();
                                                                      String b="Christmas";
                                                                      while(!a.toString().endsWith("12-25")){b+=" Eve";a=a.plusDays(1);}
                                                                      System.out.print(b)}}






                                                                      share|improve this answer














                                                                      share|improve this answer



                                                                      share|improve this answer








                                                                      edited 2 days ago

























                                                                      answered Dec 26 at 14:56









                                                                      isaace

                                                                      1814




                                                                      1814












                                                                      • You need to include imports in the bytecount (and since you need to import, this needs to be a full program)
                                                                        – ASCII-only
                                                                        2 days ago












                                                                      • You can save 6 bytes by changing a.toString() into (""+a).
                                                                        – Christopher Schultz
                                                                        yesterday


















                                                                      • You need to include imports in the bytecount (and since you need to import, this needs to be a full program)
                                                                        – ASCII-only
                                                                        2 days ago












                                                                      • You can save 6 bytes by changing a.toString() into (""+a).
                                                                        – Christopher Schultz
                                                                        yesterday
















                                                                      You need to include imports in the bytecount (and since you need to import, this needs to be a full program)
                                                                      – ASCII-only
                                                                      2 days ago






                                                                      You need to include imports in the bytecount (and since you need to import, this needs to be a full program)
                                                                      – ASCII-only
                                                                      2 days ago














                                                                      You can save 6 bytes by changing a.toString() into (""+a).
                                                                      – Christopher Schultz
                                                                      yesterday




                                                                      You can save 6 bytes by changing a.toString() into (""+a).
                                                                      – Christopher Schultz
                                                                      yesterday











                                                                      1














                                                                      Python 3, 106 Bytes



                                                                      from datetime import*
                                                                      d=date.today()
                                                                      print("Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days)





                                                                      share|improve this answer








                                                                      New contributor




                                                                      Albert Capp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                      Check out our Code of Conduct.























                                                                        1














                                                                        Python 3, 106 Bytes



                                                                        from datetime import*
                                                                        d=date.today()
                                                                        print("Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days)





                                                                        share|improve this answer








                                                                        New contributor




                                                                        Albert Capp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                        Check out our Code of Conduct.





















                                                                          1












                                                                          1








                                                                          1






                                                                          Python 3, 106 Bytes



                                                                          from datetime import*
                                                                          d=date.today()
                                                                          print("Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days)





                                                                          share|improve this answer








                                                                          New contributor




                                                                          Albert Capp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                          Check out our Code of Conduct.









                                                                          Python 3, 106 Bytes



                                                                          from datetime import*
                                                                          d=date.today()
                                                                          print("Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days)






                                                                          share|improve this answer








                                                                          New contributor




                                                                          Albert Capp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                          Check out our Code of Conduct.









                                                                          share|improve this answer



                                                                          share|improve this answer






                                                                          New contributor




                                                                          Albert Capp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                          Check out our Code of Conduct.









                                                                          answered yesterday









                                                                          Albert Capp

                                                                          111




                                                                          111




                                                                          New contributor




                                                                          Albert Capp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                          Check out our Code of Conduct.





                                                                          New contributor





                                                                          Albert Capp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                          Check out our Code of Conduct.






                                                                          Albert Capp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                          Check out our Code of Conduct.























                                                                              1















                                                                              Scala, 116 113 bytes





                                                                              var d=new java.util.Date
                                                                              print("Christmas")
                                                                              while(!(""+d).contains("c 25")){print(" Eve");d.setDate(d.getDate+1)}


                                                                              Try it online!



                                                                              Where c 25 is short for Dec 25.






                                                                              share|improve this answer



















                                                                              • 1




                                                                                I think you can use contains("c 25") instead of matches(".*c 25.*")
                                                                                – 12Me21
                                                                                12 hours ago












                                                                              • Thanks, three bytes less! 😁
                                                                                – Kjetil S.
                                                                                12 hours ago


















                                                                              1















                                                                              Scala, 116 113 bytes





                                                                              var d=new java.util.Date
                                                                              print("Christmas")
                                                                              while(!(""+d).contains("c 25")){print(" Eve");d.setDate(d.getDate+1)}


                                                                              Try it online!



                                                                              Where c 25 is short for Dec 25.






                                                                              share|improve this answer



















                                                                              • 1




                                                                                I think you can use contains("c 25") instead of matches(".*c 25.*")
                                                                                – 12Me21
                                                                                12 hours ago












                                                                              • Thanks, three bytes less! 😁
                                                                                – Kjetil S.
                                                                                12 hours ago
















                                                                              1












                                                                              1








                                                                              1







                                                                              Scala, 116 113 bytes





                                                                              var d=new java.util.Date
                                                                              print("Christmas")
                                                                              while(!(""+d).contains("c 25")){print(" Eve");d.setDate(d.getDate+1)}


                                                                              Try it online!



                                                                              Where c 25 is short for Dec 25.






                                                                              share|improve this answer















                                                                              Scala, 116 113 bytes





                                                                              var d=new java.util.Date
                                                                              print("Christmas")
                                                                              while(!(""+d).contains("c 25")){print(" Eve");d.setDate(d.getDate+1)}


                                                                              Try it online!



                                                                              Where c 25 is short for Dec 25.







                                                                              share|improve this answer














                                                                              share|improve this answer



                                                                              share|improve this answer








                                                                              edited 12 hours ago

























                                                                              answered yesterday









                                                                              Kjetil S.

                                                                              57915




                                                                              57915








                                                                              • 1




                                                                                I think you can use contains("c 25") instead of matches(".*c 25.*")
                                                                                – 12Me21
                                                                                12 hours ago












                                                                              • Thanks, three bytes less! 😁
                                                                                – Kjetil S.
                                                                                12 hours ago
















                                                                              • 1




                                                                                I think you can use contains("c 25") instead of matches(".*c 25.*")
                                                                                – 12Me21
                                                                                12 hours ago












                                                                              • Thanks, three bytes less! 😁
                                                                                – Kjetil S.
                                                                                12 hours ago










                                                                              1




                                                                              1




                                                                              I think you can use contains("c 25") instead of matches(".*c 25.*")
                                                                              – 12Me21
                                                                              12 hours ago






                                                                              I think you can use contains("c 25") instead of matches(".*c 25.*")
                                                                              – 12Me21
                                                                              12 hours ago














                                                                              Thanks, three bytes less! 😁
                                                                              – Kjetil S.
                                                                              12 hours ago






                                                                              Thanks, three bytes less! 😁
                                                                              – Kjetil S.
                                                                              12 hours ago













                                                                              1














                                                                              MATLAB, 91 bytes



                                                                              n=datetime
                                                                              x=datetime(year(n+6),12,25)
                                                                              s='Christmas'
                                                                              while days(x-n)>=1 n=n+1 s=[s,' Eve'] end


                                                                              MATLAB Non-looper, 100 bytes



                                                                              x=datenum(datetime(floor((now+5)/365.2425),12,25))
                                                                              d=x-now
                                                                              ['Christmas' repmat(' Eve',1,min(d(d>=0)))]





                                                                              share|improve this answer










                                                                              New contributor




                                                                              Anthony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                              Check out our Code of Conduct.























                                                                                1














                                                                                MATLAB, 91 bytes



                                                                                n=datetime
                                                                                x=datetime(year(n+6),12,25)
                                                                                s='Christmas'
                                                                                while days(x-n)>=1 n=n+1 s=[s,' Eve'] end


                                                                                MATLAB Non-looper, 100 bytes



                                                                                x=datenum(datetime(floor((now+5)/365.2425),12,25))
                                                                                d=x-now
                                                                                ['Christmas' repmat(' Eve',1,min(d(d>=0)))]





                                                                                share|improve this answer










                                                                                New contributor




                                                                                Anthony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                Check out our Code of Conduct.





















                                                                                  1












                                                                                  1








                                                                                  1






                                                                                  MATLAB, 91 bytes



                                                                                  n=datetime
                                                                                  x=datetime(year(n+6),12,25)
                                                                                  s='Christmas'
                                                                                  while days(x-n)>=1 n=n+1 s=[s,' Eve'] end


                                                                                  MATLAB Non-looper, 100 bytes



                                                                                  x=datenum(datetime(floor((now+5)/365.2425),12,25))
                                                                                  d=x-now
                                                                                  ['Christmas' repmat(' Eve',1,min(d(d>=0)))]





                                                                                  share|improve this answer










                                                                                  New contributor




                                                                                  Anthony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                  Check out our Code of Conduct.









                                                                                  MATLAB, 91 bytes



                                                                                  n=datetime
                                                                                  x=datetime(year(n+6),12,25)
                                                                                  s='Christmas'
                                                                                  while days(x-n)>=1 n=n+1 s=[s,' Eve'] end


                                                                                  MATLAB Non-looper, 100 bytes



                                                                                  x=datenum(datetime(floor((now+5)/365.2425),12,25))
                                                                                  d=x-now
                                                                                  ['Christmas' repmat(' Eve',1,min(d(d>=0)))]






                                                                                  share|improve this answer










                                                                                  New contributor




                                                                                  Anthony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                  Check out our Code of Conduct.









                                                                                  share|improve this answer



                                                                                  share|improve this answer








                                                                                  edited 11 hours ago





















                                                                                  New contributor




                                                                                  Anthony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                  Check out our Code of Conduct.









                                                                                  answered 12 hours ago









                                                                                  Anthony

                                                                                  1113




                                                                                  1113




                                                                                  New contributor




                                                                                  Anthony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                  Check out our Code of Conduct.





                                                                                  New contributor





                                                                                  Anthony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                  Check out our Code of Conduct.






                                                                                  Anthony is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                  Check out our Code of Conduct.























                                                                                      1














                                                                                      JavaScript 86 bytes



                                                                                      Using REPL it would be



                                                                                      for(c='Christmas',d=new Date;(d+'').indexOf('c 25')<0;d=new Date(+d+864e5))c+=' Eve';c





                                                                                      share|improve this answer








                                                                                      New contributor




                                                                                      Vadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                      Check out our Code of Conduct.























                                                                                        1














                                                                                        JavaScript 86 bytes



                                                                                        Using REPL it would be



                                                                                        for(c='Christmas',d=new Date;(d+'').indexOf('c 25')<0;d=new Date(+d+864e5))c+=' Eve';c





                                                                                        share|improve this answer








                                                                                        New contributor




                                                                                        Vadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                        Check out our Code of Conduct.





















                                                                                          1












                                                                                          1








                                                                                          1






                                                                                          JavaScript 86 bytes



                                                                                          Using REPL it would be



                                                                                          for(c='Christmas',d=new Date;(d+'').indexOf('c 25')<0;d=new Date(+d+864e5))c+=' Eve';c





                                                                                          share|improve this answer








                                                                                          New contributor




                                                                                          Vadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                          Check out our Code of Conduct.









                                                                                          JavaScript 86 bytes



                                                                                          Using REPL it would be



                                                                                          for(c='Christmas',d=new Date;(d+'').indexOf('c 25')<0;d=new Date(+d+864e5))c+=' Eve';c






                                                                                          share|improve this answer








                                                                                          New contributor




                                                                                          Vadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                          Check out our Code of Conduct.









                                                                                          share|improve this answer



                                                                                          share|improve this answer






                                                                                          New contributor




                                                                                          Vadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                          Check out our Code of Conduct.









                                                                                          answered 7 hours ago









                                                                                          Vadim

                                                                                          1114




                                                                                          1114




                                                                                          New contributor




                                                                                          Vadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                          Check out our Code of Conduct.





                                                                                          New contributor





                                                                                          Vadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                          Check out our Code of Conduct.






                                                                                          Vadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                                                          Check out our Code of Conduct.























                                                                                              0















                                                                                              C# (Visual C# Interactive Compiler), 141 bytes





                                                                                              var g=DateTime.Now;Write("Christmas"+string.Concat(Enumerable.Repeat(" Eve",(new DateTime(g.Year+(g.Day>25&g.Month>11?1:0),12,25)-g).Days)));


                                                                                              Try it online!






                                                                                              share|improve this answer



















                                                                                              • 1




                                                                                                I don't think this works for the 30th of November...
                                                                                                – Neil
                                                                                                Dec 25 at 9:56










                                                                                              • Fixed now, I forgot to add a check to if it was December or not
                                                                                                – Embodiment of Ignorance
                                                                                                Dec 25 at 17:58










                                                                                              • Are you sure about Month > 25?
                                                                                                – Neil
                                                                                                Dec 25 at 19:12










                                                                                              • Fixed it now...
                                                                                                – Embodiment of Ignorance
                                                                                                Dec 25 at 20:20










                                                                                              • Is the ?1:0 nessesary? doesn't & return an integer?
                                                                                                – 12Me21
                                                                                                Dec 25 at 23:33
















                                                                                              0















                                                                                              C# (Visual C# Interactive Compiler), 141 bytes





                                                                                              var g=DateTime.Now;Write("Christmas"+string.Concat(Enumerable.Repeat(" Eve",(new DateTime(g.Year+(g.Day>25&g.Month>11?1:0),12,25)-g).Days)));


                                                                                              Try it online!






                                                                                              share|improve this answer



















                                                                                              • 1




                                                                                                I don't think this works for the 30th of November...
                                                                                                – Neil
                                                                                                Dec 25 at 9:56










                                                                                              • Fixed now, I forgot to add a check to if it was December or not
                                                                                                – Embodiment of Ignorance
                                                                                                Dec 25 at 17:58










                                                                                              • Are you sure about Month > 25?
                                                                                                – Neil
                                                                                                Dec 25 at 19:12










                                                                                              • Fixed it now...
                                                                                                – Embodiment of Ignorance
                                                                                                Dec 25 at 20:20










                                                                                              • Is the ?1:0 nessesary? doesn't & return an integer?
                                                                                                – 12Me21
                                                                                                Dec 25 at 23:33














                                                                                              0












                                                                                              0








                                                                                              0







                                                                                              C# (Visual C# Interactive Compiler), 141 bytes





                                                                                              var g=DateTime.Now;Write("Christmas"+string.Concat(Enumerable.Repeat(" Eve",(new DateTime(g.Year+(g.Day>25&g.Month>11?1:0),12,25)-g).Days)));


                                                                                              Try it online!






                                                                                              share|improve this answer















                                                                                              C# (Visual C# Interactive Compiler), 141 bytes





                                                                                              var g=DateTime.Now;Write("Christmas"+string.Concat(Enumerable.Repeat(" Eve",(new DateTime(g.Year+(g.Day>25&g.Month>11?1:0),12,25)-g).Days)));


                                                                                              Try it online!







                                                                                              share|improve this answer














                                                                                              share|improve this answer



                                                                                              share|improve this answer








                                                                                              edited Dec 25 at 20:19

























                                                                                              answered Dec 25 at 4:37









                                                                                              Embodiment of Ignorance

                                                                                              25711




                                                                                              25711








                                                                                              • 1




                                                                                                I don't think this works for the 30th of November...
                                                                                                – Neil
                                                                                                Dec 25 at 9:56










                                                                                              • Fixed now, I forgot to add a check to if it was December or not
                                                                                                – Embodiment of Ignorance
                                                                                                Dec 25 at 17:58










                                                                                              • Are you sure about Month > 25?
                                                                                                – Neil
                                                                                                Dec 25 at 19:12










                                                                                              • Fixed it now...
                                                                                                – Embodiment of Ignorance
                                                                                                Dec 25 at 20:20










                                                                                              • Is the ?1:0 nessesary? doesn't & return an integer?
                                                                                                – 12Me21
                                                                                                Dec 25 at 23:33














                                                                                              • 1




                                                                                                I don't think this works for the 30th of November...
                                                                                                – Neil
                                                                                                Dec 25 at 9:56










                                                                                              • Fixed now, I forgot to add a check to if it was December or not
                                                                                                – Embodiment of Ignorance
                                                                                                Dec 25 at 17:58










                                                                                              • Are you sure about Month > 25?
                                                                                                – Neil
                                                                                                Dec 25 at 19:12










                                                                                              • Fixed it now...
                                                                                                – Embodiment of Ignorance
                                                                                                Dec 25 at 20:20










                                                                                              • Is the ?1:0 nessesary? doesn't & return an integer?
                                                                                                – 12Me21
                                                                                                Dec 25 at 23:33








                                                                                              1




                                                                                              1




                                                                                              I don't think this works for the 30th of November...
                                                                                              – Neil
                                                                                              Dec 25 at 9:56




                                                                                              I don't think this works for the 30th of November...
                                                                                              – Neil
                                                                                              Dec 25 at 9:56












                                                                                              Fixed now, I forgot to add a check to if it was December or not
                                                                                              – Embodiment of Ignorance
                                                                                              Dec 25 at 17:58




                                                                                              Fixed now, I forgot to add a check to if it was December or not
                                                                                              – Embodiment of Ignorance
                                                                                              Dec 25 at 17:58












                                                                                              Are you sure about Month > 25?
                                                                                              – Neil
                                                                                              Dec 25 at 19:12




                                                                                              Are you sure about Month > 25?
                                                                                              – Neil
                                                                                              Dec 25 at 19:12












                                                                                              Fixed it now...
                                                                                              – Embodiment of Ignorance
                                                                                              Dec 25 at 20:20




                                                                                              Fixed it now...
                                                                                              – Embodiment of Ignorance
                                                                                              Dec 25 at 20:20












                                                                                              Is the ?1:0 nessesary? doesn't & return an integer?
                                                                                              – 12Me21
                                                                                              Dec 25 at 23:33




                                                                                              Is the ?1:0 nessesary? doesn't & return an integer?
                                                                                              – 12Me21
                                                                                              Dec 25 at 23:33











                                                                                              0















                                                                                              Red, 89 86 84 78 76 bytes



                                                                                              -10 bytes thanks to ASCII-only!



                                                                                              does[a: now prin"Christmas"while[a/3 * 31 + a/4 <> 397][prin" Eve"a: a + 1]]


                                                                                              Try it online!






                                                                                              share|improve this answer























                                                                                              • 84
                                                                                                – ASCII-only
                                                                                                Dec 26 at 9:04










                                                                                              • @ASCII-only Hmm, of course! Thank you!
                                                                                                – Galen Ivanov
                                                                                                Dec 26 at 10:01












                                                                                              • 78
                                                                                                – ASCII-only
                                                                                                Dec 26 at 23:45










                                                                                              • 76
                                                                                                – ASCII-only
                                                                                                Dec 27 at 0:12










                                                                                              • @ASCII-only Your 76-byte version does not give correct result when run on Christmas: Date as an argument I feel stupid for not using only now and not now/date. Thank you for your improvements!
                                                                                                – Galen Ivanov
                                                                                                2 days ago
















                                                                                              0















                                                                                              Red, 89 86 84 78 76 bytes



                                                                                              -10 bytes thanks to ASCII-only!



                                                                                              does[a: now prin"Christmas"while[a/3 * 31 + a/4 <> 397][prin" Eve"a: a + 1]]


                                                                                              Try it online!






                                                                                              share|improve this answer























                                                                                              • 84
                                                                                                – ASCII-only
                                                                                                Dec 26 at 9:04










                                                                                              • @ASCII-only Hmm, of course! Thank you!
                                                                                                – Galen Ivanov
                                                                                                Dec 26 at 10:01












                                                                                              • 78
                                                                                                – ASCII-only
                                                                                                Dec 26 at 23:45










                                                                                              • 76
                                                                                                – ASCII-only
                                                                                                Dec 27 at 0:12










                                                                                              • @ASCII-only Your 76-byte version does not give correct result when run on Christmas: Date as an argument I feel stupid for not using only now and not now/date. Thank you for your improvements!
                                                                                                – Galen Ivanov
                                                                                                2 days ago














                                                                                              0












                                                                                              0








                                                                                              0







                                                                                              Red, 89 86 84 78 76 bytes



                                                                                              -10 bytes thanks to ASCII-only!



                                                                                              does[a: now prin"Christmas"while[a/3 * 31 + a/4 <> 397][prin" Eve"a: a + 1]]


                                                                                              Try it online!






                                                                                              share|improve this answer















                                                                                              Red, 89 86 84 78 76 bytes



                                                                                              -10 bytes thanks to ASCII-only!



                                                                                              does[a: now prin"Christmas"while[a/3 * 31 + a/4 <> 397][prin" Eve"a: a + 1]]


                                                                                              Try it online!







                                                                                              share|improve this answer














                                                                                              share|improve this answer



                                                                                              share|improve this answer








                                                                                              edited yesterday

























                                                                                              answered Dec 25 at 8:19









                                                                                              Galen Ivanov

                                                                                              6,31711032




                                                                                              6,31711032












                                                                                              • 84
                                                                                                – ASCII-only
                                                                                                Dec 26 at 9:04










                                                                                              • @ASCII-only Hmm, of course! Thank you!
                                                                                                – Galen Ivanov
                                                                                                Dec 26 at 10:01












                                                                                              • 78
                                                                                                – ASCII-only
                                                                                                Dec 26 at 23:45










                                                                                              • 76
                                                                                                – ASCII-only
                                                                                                Dec 27 at 0:12










                                                                                              • @ASCII-only Your 76-byte version does not give correct result when run on Christmas: Date as an argument I feel stupid for not using only now and not now/date. Thank you for your improvements!
                                                                                                – Galen Ivanov
                                                                                                2 days ago


















                                                                                              • 84
                                                                                                – ASCII-only
                                                                                                Dec 26 at 9:04










                                                                                              • @ASCII-only Hmm, of course! Thank you!
                                                                                                – Galen Ivanov
                                                                                                Dec 26 at 10:01












                                                                                              • 78
                                                                                                – ASCII-only
                                                                                                Dec 26 at 23:45










                                                                                              • 76
                                                                                                – ASCII-only
                                                                                                Dec 27 at 0:12










                                                                                              • @ASCII-only Your 76-byte version does not give correct result when run on Christmas: Date as an argument I feel stupid for not using only now and not now/date. Thank you for your improvements!
                                                                                                – Galen Ivanov
                                                                                                2 days ago
















                                                                                              84
                                                                                              – ASCII-only
                                                                                              Dec 26 at 9:04




                                                                                              84
                                                                                              – ASCII-only
                                                                                              Dec 26 at 9:04












                                                                                              @ASCII-only Hmm, of course! Thank you!
                                                                                              – Galen Ivanov
                                                                                              Dec 26 at 10:01






                                                                                              @ASCII-only Hmm, of course! Thank you!
                                                                                              – Galen Ivanov
                                                                                              Dec 26 at 10:01














                                                                                              78
                                                                                              – ASCII-only
                                                                                              Dec 26 at 23:45




                                                                                              78
                                                                                              – ASCII-only
                                                                                              Dec 26 at 23:45












                                                                                              76
                                                                                              – ASCII-only
                                                                                              Dec 27 at 0:12




                                                                                              76
                                                                                              – ASCII-only
                                                                                              Dec 27 at 0:12












                                                                                              @ASCII-only Your 76-byte version does not give correct result when run on Christmas: Date as an argument I feel stupid for not using only now and not now/date. Thank you for your improvements!
                                                                                              – Galen Ivanov
                                                                                              2 days ago




                                                                                              @ASCII-only Your 76-byte version does not give correct result when run on Christmas: Date as an argument I feel stupid for not using only now and not now/date. Thank you for your improvements!
                                                                                              – Galen Ivanov
                                                                                              2 days ago











                                                                                              0















                                                                                              Perl 5, 68 bytes





                                                                                              print"Christmas";print" Eve"while localtime($i++*86400+time)!~/c 25/


                                                                                              Try it online!



                                                                                              Where c 25 is short for Dec 25.






                                                                                              share|improve this answer























                                                                                              • Replace localtime with gmtime to save 3 bytes. After all, the question didn't state in which timezone Christmas is to be considered.
                                                                                                – Abigail
                                                                                                8 hours ago
















                                                                                              0















                                                                                              Perl 5, 68 bytes





                                                                                              print"Christmas";print" Eve"while localtime($i++*86400+time)!~/c 25/


                                                                                              Try it online!



                                                                                              Where c 25 is short for Dec 25.






                                                                                              share|improve this answer























                                                                                              • Replace localtime with gmtime to save 3 bytes. After all, the question didn't state in which timezone Christmas is to be considered.
                                                                                                – Abigail
                                                                                                8 hours ago














                                                                                              0












                                                                                              0








                                                                                              0







                                                                                              Perl 5, 68 bytes





                                                                                              print"Christmas";print" Eve"while localtime($i++*86400+time)!~/c 25/


                                                                                              Try it online!



                                                                                              Where c 25 is short for Dec 25.






                                                                                              share|improve this answer















                                                                                              Perl 5, 68 bytes





                                                                                              print"Christmas";print" Eve"while localtime($i++*86400+time)!~/c 25/


                                                                                              Try it online!



                                                                                              Where c 25 is short for Dec 25.







                                                                                              share|improve this answer














                                                                                              share|improve this answer



                                                                                              share|improve this answer








                                                                                              edited yesterday

























                                                                                              answered yesterday









                                                                                              Kjetil S.

                                                                                              57915




                                                                                              57915












                                                                                              • Replace localtime with gmtime to save 3 bytes. After all, the question didn't state in which timezone Christmas is to be considered.
                                                                                                – Abigail
                                                                                                8 hours ago


















                                                                                              • Replace localtime with gmtime to save 3 bytes. After all, the question didn't state in which timezone Christmas is to be considered.
                                                                                                – Abigail
                                                                                                8 hours ago
















                                                                                              Replace localtime with gmtime to save 3 bytes. After all, the question didn't state in which timezone Christmas is to be considered.
                                                                                              – Abigail
                                                                                              8 hours ago




                                                                                              Replace localtime with gmtime to save 3 bytes. After all, the question didn't state in which timezone Christmas is to be considered.
                                                                                              – Abigail
                                                                                              8 hours ago











                                                                                              0














                                                                                              perl -E, 25 bytes



                                                                                              perl -E'say"Christmas"," Eve"x365'


                                                                                              This will print the required answer -- and then some extra characters. But since that wasn't explicitly forbidden, I'm just going to bend the rules. Heavily.






                                                                                              share|improve this answer


























                                                                                                0














                                                                                                perl -E, 25 bytes



                                                                                                perl -E'say"Christmas"," Eve"x365'


                                                                                                This will print the required answer -- and then some extra characters. But since that wasn't explicitly forbidden, I'm just going to bend the rules. Heavily.






                                                                                                share|improve this answer
























                                                                                                  0












                                                                                                  0








                                                                                                  0






                                                                                                  perl -E, 25 bytes



                                                                                                  perl -E'say"Christmas"," Eve"x365'


                                                                                                  This will print the required answer -- and then some extra characters. But since that wasn't explicitly forbidden, I'm just going to bend the rules. Heavily.






                                                                                                  share|improve this answer












                                                                                                  perl -E, 25 bytes



                                                                                                  perl -E'say"Christmas"," Eve"x365'


                                                                                                  This will print the required answer -- and then some extra characters. But since that wasn't explicitly forbidden, I'm just going to bend the rules. Heavily.







                                                                                                  share|improve this answer












                                                                                                  share|improve this answer



                                                                                                  share|improve this answer










                                                                                                  answered 7 hours ago









                                                                                                  Abigail

                                                                                                  41717




                                                                                                  41717























                                                                                                      -1














                                                                                                      PHP, 84 bytes



                                                                                                      Probably doesn't work that well.



                                                                                                      $d=intval(date("z"));echo("Christmas ".str_repeat("Eve ",(358-$d)<0?724-$d:358-$d));





                                                                                                      share|improve this answer

















                                                                                                      • 2




                                                                                                        Will this work in leap year?
                                                                                                        – tsh
                                                                                                        Dec 25 at 13:02










                                                                                                      • No sir it will NOT. I have no idea how to implement that.
                                                                                                        – Adrian Zhang
                                                                                                        Dec 25 at 17:31












                                                                                                      • a little long, but a nice approach. Take a look at date("L"): 1 for leap year, 0 otherwise. Don´t forget to use it for the next year too. Try ($d=date(z))>359; you can use Christmas<?= that way.
                                                                                                        – Titus
                                                                                                        Dec 25 at 20:05


















                                                                                                      -1














                                                                                                      PHP, 84 bytes



                                                                                                      Probably doesn't work that well.



                                                                                                      $d=intval(date("z"));echo("Christmas ".str_repeat("Eve ",(358-$d)<0?724-$d:358-$d));





                                                                                                      share|improve this answer

















                                                                                                      • 2




                                                                                                        Will this work in leap year?
                                                                                                        – tsh
                                                                                                        Dec 25 at 13:02










                                                                                                      • No sir it will NOT. I have no idea how to implement that.
                                                                                                        – Adrian Zhang
                                                                                                        Dec 25 at 17:31












                                                                                                      • a little long, but a nice approach. Take a look at date("L"): 1 for leap year, 0 otherwise. Don´t forget to use it for the next year too. Try ($d=date(z))>359; you can use Christmas<?= that way.
                                                                                                        – Titus
                                                                                                        Dec 25 at 20:05
















                                                                                                      -1












                                                                                                      -1








                                                                                                      -1






                                                                                                      PHP, 84 bytes



                                                                                                      Probably doesn't work that well.



                                                                                                      $d=intval(date("z"));echo("Christmas ".str_repeat("Eve ",(358-$d)<0?724-$d:358-$d));





                                                                                                      share|improve this answer












                                                                                                      PHP, 84 bytes



                                                                                                      Probably doesn't work that well.



                                                                                                      $d=intval(date("z"));echo("Christmas ".str_repeat("Eve ",(358-$d)<0?724-$d:358-$d));






                                                                                                      share|improve this answer












                                                                                                      share|improve this answer



                                                                                                      share|improve this answer










                                                                                                      answered Dec 25 at 7:22









                                                                                                      Adrian Zhang

                                                                                                      20515




                                                                                                      20515








                                                                                                      • 2




                                                                                                        Will this work in leap year?
                                                                                                        – tsh
                                                                                                        Dec 25 at 13:02










                                                                                                      • No sir it will NOT. I have no idea how to implement that.
                                                                                                        – Adrian Zhang
                                                                                                        Dec 25 at 17:31












                                                                                                      • a little long, but a nice approach. Take a look at date("L"): 1 for leap year, 0 otherwise. Don´t forget to use it for the next year too. Try ($d=date(z))>359; you can use Christmas<?= that way.
                                                                                                        – Titus
                                                                                                        Dec 25 at 20:05
















                                                                                                      • 2




                                                                                                        Will this work in leap year?
                                                                                                        – tsh
                                                                                                        Dec 25 at 13:02










                                                                                                      • No sir it will NOT. I have no idea how to implement that.
                                                                                                        – Adrian Zhang
                                                                                                        Dec 25 at 17:31












                                                                                                      • a little long, but a nice approach. Take a look at date("L"): 1 for leap year, 0 otherwise. Don´t forget to use it for the next year too. Try ($d=date(z))>359; you can use Christmas<?= that way.
                                                                                                        – Titus
                                                                                                        Dec 25 at 20:05










                                                                                                      2




                                                                                                      2




                                                                                                      Will this work in leap year?
                                                                                                      – tsh
                                                                                                      Dec 25 at 13:02




                                                                                                      Will this work in leap year?
                                                                                                      – tsh
                                                                                                      Dec 25 at 13:02












                                                                                                      No sir it will NOT. I have no idea how to implement that.
                                                                                                      – Adrian Zhang
                                                                                                      Dec 25 at 17:31






                                                                                                      No sir it will NOT. I have no idea how to implement that.
                                                                                                      – Adrian Zhang
                                                                                                      Dec 25 at 17:31














                                                                                                      a little long, but a nice approach. Take a look at date("L"): 1 for leap year, 0 otherwise. Don´t forget to use it for the next year too. Try ($d=date(z))>359; you can use Christmas<?= that way.
                                                                                                      – Titus
                                                                                                      Dec 25 at 20:05






                                                                                                      a little long, but a nice approach. Take a look at date("L"): 1 for leap year, 0 otherwise. Don´t forget to use it for the next year too. Try ($d=date(z))>359; you can use Christmas<?= that way.
                                                                                                      – Titus
                                                                                                      Dec 25 at 20:05




















                                                                                                      draft saved

                                                                                                      draft discarded




















































                                                                                                      If this is an answer to a challenge…




                                                                                                      • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                                                                                      • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                                                                                        Explanations of your answer make it more interesting to read and are very much encouraged.


                                                                                                      • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.



                                                                                                      More generally…




                                                                                                      • …Please make sure to answer the question and provide sufficient detail.


                                                                                                      • …Avoid asking for help, clarification or responding to other answers (use comments instead).






                                                                                                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                                                                      Please pay close attention to the following guidance:


                                                                                                      • Please be sure to answer the question. Provide details and share your research!

                                                                                                      But avoid



                                                                                                      • Asking for help, clarification, or responding to other answers.

                                                                                                      • Making statements based on opinion; back them up with references or personal experience.


                                                                                                      To learn more, see our tips on writing great answers.




                                                                                                      draft saved


                                                                                                      draft discarded














                                                                                                      StackExchange.ready(
                                                                                                      function () {
                                                                                                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f178003%2fencode-the-date-in-christmas-eve-format%23new-answer', 'question_page');
                                                                                                      }
                                                                                                      );

                                                                                                      Post as a guest















                                                                                                      Required, but never shown





















































                                                                                                      Required, but never shown














                                                                                                      Required, but never shown












                                                                                                      Required, but never shown







                                                                                                      Required, but never shown

































                                                                                                      Required, but never shown














                                                                                                      Required, but never shown












                                                                                                      Required, but never shown







                                                                                                      Required, but never shown







                                                                                                      Popular posts from this blog

                                                                                                      Сан-Квентин

                                                                                                      Алькесар

                                                                                                      Josef Freinademetz