[Question]
  [
It's Christmas everybody, and here's a code-golf challenge to celebrate. You need to make a program to print out a present. Specifically, the words "Merry Christmas". BUT, there is a catch: this program must only work if it is the 25th of December. If the code is run on any other day, then the program should crash.
This is Code-Golf, so the answer with the least amount of bytes wins.
Merry Christmas!
  
[Answer]
## Pyke, 21 bytes
```
.dↄґ6C65h*325q/Al
```
[Try it here!](http://pyke.catbus.co.uk/?code=.d%02%E2%86%84%D2%916C65h%2a325q%2FAl)
```
     C65h*        -   multiply the day by the (current month + 1)
          325q    -  ^ == 325
    6         /   - 6 / ^
.dↄґ              -  load "merry christmas"
               Al - ^.capwords()
```
Or 18 bytes noncompetitive.
```
.dↄґ6Cs6Y1q/Al
```
Exactly the same except for this section:
```
Cs6Y1q 
C      -    get_time()
 s6    -   add 1 week
   Y   -  get day of the year
    1q - ^ == 1
```
[Try it here!](http://pyke.catbus.co.uk/?code=.d%02%E2%86%84%D2%916Cs6Y1q%2FAl)
[Answer]
# JavaScript, ~~55~~ ~~53~~ 46 bytes
Note: this has only been tested in Google Chrome, program may behave differently from browser to browser (or device to device)
*2 bytes saved thanks to @ConorO'Brien*
*7 bytes saved thanks to @ETHProductions*
```
alert(/c 25/.test(Date())?"Merry Christmas":a)
```
Exits with `Uncaught ReferenceError: a is not defined` if the date is not `Dec 25`. I'm not really sure if this counts as crashing
```
alert(/c 25/.test(Date())?"Merry Christmas":a)
```
[Answer]
# Python 3, ~~66~~ 63 bytes
Thanks to ideas from JavaScript / ES answers here I managed to squeeze some bytes. Index a dictionary - non-existent keys will raise a `KeyError`. The following code works in local time zone
```
import time;print({1:'Merry Christmas'}['c 25'in time.ctime()])
```
The output format for `ctime` isn't locale-dependent - the format is always ~ `'Sun Dec 25 19:23:05 2016'`. Since only in December does the 3-letter abbreviation end with `c`, it is safe to use `'c 25'in time.ctime()` here.
---
**Previous version:**
This works in UTC time zone. For local time zone one needs to `s/gm/local` for 3 more bytes. For Python 2, one can remove parentheses from `print` for 65 bytes.
```
import time;print({(12,25):'Merry Christmas'}[time.gmtime()[1:3]])
```
The construct throws `KeyError` on other dates:
```
>>> import time;print({(1,1):'Happy New Year'}[time.gmtime()[1:3]])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: (12, 25)
```
[Answer]
# PHP, ~~39~~ 38 bytes, not competing (doesn´t crash)
```
<?=date(md)-1225?"":"Merry Christmas";
```
or
```
<?date(md)-1225?die:0?>Merry Christmas
```
or
```
<?=["Merry Christmas"][date(md)-1225];
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~68~~ ~~67~~ 65 bytes
-1 with thanks to @muddyfish
Thanks to @AnttiHaapala for the idea that saved another couple.
```
import time;print['Merry Christmas'][(12,25)!=time.gmtime()[1:3]]
```
[Try it online!](https://tio.run/nexus/python2#@5@ZW5BfVKJQkpmbal1QlJlXEq3um1pUVKngnFGUWVySm1isHhutYWikY2SqqWgLUqaXnguiNDSjDa2MY2P//wcA "Python 2 – TIO Nexus")
Throws an IndexError if not 25th Dec.
Non-competing version for 59 bytes as it only works for non Leap years (uses day of year which is 360 this year but 361 in leap years)
```
import time;print['Merry Christmas'][360!=time.gmtime()[7]]
```
[Answer]
## R, 52 61 58 bytes
```
`if`(format(Sys.Date(),"%m%d")=="1225","Merry Christmas",)
```
If the current date is not the 25th of December then an error is returned because no third argument is supplied to `if`.
Edit: Fixed a silly error
[Answer]
My first time around here... Started with the best language ever for this job:
# Java, ~~200~~ ~~188~~ bytes (thanks to @Daniel Gray), 186 bytes removing "ln" from print.
```
import java.util.*;public class a{public static void main(String[]r){Calendar c=Calendar.getInstance();if(!(c.get(2)==11&&c.get(5)==25)){int i=1/0;}System.out.print("Merry Christmas");}}
```
[Try it here!](https://www.compilejava.net/)
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~34~~ 33 bytes
```
'Merry Christmas'IHh&Z'5U12h=?}Yl
```
This works in [current version (19.7.0)](https://github.com/lmendo/MATL/releases/tag/19.7.0) of the language. To cause the error, the following code exploits the fact that the logarithm of a string gives an error (this may change in future versions).
[Try it online!](https://tio.run/nexus/matl#@6/um1pUVKngnFGUWVySm1is7umRoRalbhpqaJRha18bmfP/PwA "MATL – TIO Nexus")
### Explanation
```
'Merry Christmas'  % Push this string
IHh                % Push 3, then 2, concatenate: gives array [3 2]
&Z'                % Get 3rd and 2nd outputs of clock vector: current day and month
5U12h              % Push 5, square, push 12, concatenate: gives [25 12]
=                  % Compare if corresponding entries are equal in the two arrays
?                  % If all entries are equal: do nothing
}                  % Else
  Yl               %   Logarithm. Gives an error when applied on a string
                   % End (implicit). Display (implicit)
```
[Answer]
## [QBIC](https://drive.google.com/drive/folders/0B0R1Jgqp8Gg4cVJCZkRkdEthZDQ), 48 bytes
```
~left$$|(_D,5)=@12-25||?@Merry Christmas|\?a(12)
```
Explanation:
```
~             IF
left$$|(_D,5) the date string starts with
=@12-25|      the string "12-25"
|             THEN
[[email protected]](/cdn-cgi/l/email-protection)|     PRINT "Merry Christmas"
\             ELSE
?a(12)        Print the twelfth index of an undefined array. 
              Since there are only 11 elements in undefined arrays, this 
              results in an index-out-of-bounds error.    
The the IF statement is auto-closed by QBIC.
```
This assumes American `MM-DD` date notation. This would be shorter if I'd finally make a Substring function in QBIC.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~32~~ 21 bytes
Saved 11 bytes thanks to Adnan's string compression :) .
```
1žfže‚12D·>‚Q÷”ÞÙŒÎ”×
```
## Explanation
```
 žfže‚                Push [current month, current day]
      12D·>‚          Push [12, 25]
            Q         Push tmp = 1 if the two arrays are equal, tmp = 0 otherwise
1            ÷        Evaluate x = 1/tmp. If tmp = 0 a division by 0 exception is thrown
              ”ÞÙŒÎ”× Implicitly display "Merry Christmas" x times
```
[Try it online!](https://tio.run/nexus/05ab1e#@294dF/a0X2pjxpmGRq5HNpuB2QEHt7@qGHu4XmHZx6ddLgPxJz@/z8A "05AB1E – TIO Nexus")
I did what came to mind first, so there may be better approaches for this one. But PPCG deserves a Merry Christmas in 05AB1E as well ;) .
[Answer]
# C# / CS Script ~~106~~ ~~100~~ 99 bytes
99 byte solution
```
using System;int i;Console.WriteLine(DateTime.Now.ToString("dM")=="2512"?"Merry Christmas":i/0+"");
```
[Try it here!](https://dotnetfiddle.net/VNCSxf)
100 byte solution (prefer this one... a bit different)
```
using System;int i;Console.WriteLine(DateTime.Now.AddDays(7).DayOfYear==1?"Merry Christmas":i/0+"");
```
Explained:
```
using System;
int i;
// if today plus 7 days is the first day of the year, then it's xmas!
Console.WriteLine(DateTime.Now.AddDays(7).DayOfYear==1
    ? "Merry Christmas"
// otherwise divide i by 0
    : i/0+"");
```
`DateTime.Now.AddDays(7).DayOfYear==1` is one byte shorter than `DateTime.Now.ToString("ddMM")=="2512"` but 1 byte longer than `DateTime.Now.ToString("dM")=="2512"`
[Answer]
# C#/CS Script, 96 Bytes, Mostly Plagiarized from Erresen
```
using System;Console.WriteLine(DateTime.Now.AddDays(7).DayOfYear==1?"Merry Christmas":1/0+"");
```
Deletes the `int i` declaration in favor of hard coding the division. I would leave this as a comment but don't have the reputation.
[Answer]
# bash + Unix utilities, ~~51~~ ~~49~~ 47 bytes
```
((`date +%m%d`-1225))&&${};echo Merry Christmas
```
\*Thanks to @KenY-N for pointing out that the quotes in the echo can be removed, and to @IporSircer for reducing the condition size by 2 bytes.
[Answer]
# Groovy, 57 bytes
```
print new Date().format("Md")=="1225"?"Merry Christmas":b
```
Crashes on dates other than 25.12. with `groovy.lang.MissingPropertyException` because `b` is not defined.
[Answer]
# [Stacked](https://github.com/ConorOBrien-Foxx/stacked/), 42 bytes
[Try it here!](https://conorobrien-foxx.github.io/stacked/stacked.html)
```
('Merry Christmas')'MMDD'date'1225'=¬#out
```
This creates a single-element array containing namely `'Merry Christmas!'`. After, it puts the date into a string with the month followed by the day. It checks for equality with `'1225'` (Christmas), inverts it with `¬`, then gets that member from the preceding array. If it isn't Christmas, this will error with an index error. Otherwise, it prints `Merry Christmas`. (Change the date in the string to see how it works on other days.)
[Answer]
## Batch, 66 bytes
```
@echo off
if %date:~0,5%==25/12 echo Merry Christmas&exit/b
if
```
The trailing newline is significant, as it causes parsing of the `if` statement to fail. You may need to tweak the date check to match your local date format.
[Answer]
# Python 2, ~~69 77~~ 75 or ~~72~~ 70 Bytes
```
import time
if time.strftime("%d%m")=="2512":print"Merry Christmas"
else:1/0
```
If it doesn't matter if it exits with an error when it is Christmas, then:
```
import time
if time.strftime("%d%m")=="2512":print"Merry Christmas"
1/0
```
EDIT:
Thanks @Flp.Tkc for pointing out that I needed to raise an error
-2 Bytes from @Max for pointing out about removing colons from the strftime function
[Answer]
# CJam, 28
```
et[C25]#1="Merry Christmas"/
```
[Try it online](http://cjam.aditsu.net/#code=et%5BC25%5D%231%3D%22Merry%20Christmas%22%2F)
**Explanation:**
```
et                   push an array of current [year month day hour ...]
[C25]                push the array [12 25] (C=12)
#                    find the position of the 2nd array within the first one
1=                   compare it with 1, resulting in 1 for 1 and 0 otherwise
"Merry Christmas"/   split "Merry Christmas" into pieces of that length
                      (it crashes if the length is 0)
                     at the end, all the pieces are concatenated
                      and printed automatically
```
[Answer]
## C#.NET, ~~180~~ ~~172~~ 171 bytes
*Saved 8 bytes thanks to Kritixi Lithos*
*Saved 1 byte thanks to Kritixi Lithos, again ;)*
```
namespace System{class P{static void Main(string[] args){var d=DateTime.Today;if(d.Day==25)if(d.Month>11){Console.Write("Merry Christmas!");return;}throw new Exception();}}}
```
Alternative, ungolfed variant:
```
namespace System //In System, so we don't have to use system.
{
    class Program
    {
        static void Main(string[] args) //Main function.
        {
            var d = DateTime.Today; //Get Today.
            if (d.Day == 25) if (d.Month == 12) //Day has to be 25th, Month has to be 12nd.
                {
                    Console.Write("Merry Christmas!"); return; //Prints.
                }
            throw new NotChristmasException(); //Errors/Crashes the program.
        }
    }
    class NotChristmasException : Exception { } //Holiday exception, hooray!
}
```
[Answer]
# Mathematica, 46 bytes
```
If[Today[[1,2;;]]=={12,25},"Merry Christmas!"]
```
[Answer]
# Common Lisp, 140
```
(let((m(multiple-value-list(decode-universal-time(get-universal-time)))))(if(and(eq(nth 3 m)25)(eq(nth 4 m)12))(write"Merry Christmas")(c)))
```
Crashes with undefined function if the date isn't right.
[Answer]
## awk, 29 bytes (+ length("Merry xmas"))
```
v=1225==strftime("%m%d")||1/0
```
Running it:
```
$ echo Merry xmas | awk 'v=1225==strftime("%m%d")||1/0'
awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted
```
Season greeting is piped to `awk`. `strftime` returns month+day (for example `1226`) and if it matches `1225` `$0` record gets outputed. Result of comparison `1225==1226` is placed to `v` var which is used to divide 1 if the date comparison fails.
[Answer]
## Haskell, 116
Crashes with "Non-exhaustive patterns in function f" if it's not Christmas.
```
import Data.Time
f(_,12,25)="Merry Christmas"
main=getZonedTime>>=print.f.toGregorian.localDay.zonedTimeToLocalTime
```
Unfortunately, there's no function that allows you to just immediately get the time in a useful format, so most of this is converting the date formats.
[Answer]
# C#, ~~122~~ 104 bytes
18 bytes saved, thanks to @raznagul
```
using System;i=>{if(DateTime.Now.AddDays(7).DayOfYear==1)Console.Write("Merry Christmas");else{i/=0;};};
```
It adds 7 days to the current day, and checks if it is the first day of the year, if yes, it displays "Merry Christmas", otherwise it divides by zero.
[Answer]
## Ruby, 69 bytes
```
if Time.now.strftime("%j")=="360";puts "Merry Christmas";else 0/0;end
```
Works in 2016. Doesn't differentiate between normal and leap years, may need to be adjusted for non-leap years.
[Answer]
# ForceLang, 180 bytes
```
set s datetime.toDateString datetime.now()
set t "Dec 25"
def c s.charAt i
def d t.charAt i
set i -1
label 1
set i 1+i
if i=6
 io.write "Merry Christmas!"
 exit()
if c=d
goto 1
z.z
```
(Remember that `datetime.toDateString` is locale-dependent, so this may not work depending on your locale)
[Answer]
# C#, 90 bytes
```
using System;Console.Write(new[]{"Merry Christmas"}[DateTime.Now.AddDays(7).DayOfYear-1]);
```
Throws IndexOutOfRangeException if it's not christmas.
[Try it here!](https://dotnetfiddle.net/6wbSVV)
[Answer]
# bash command line, ~~45~~ ~~48~~ 49 48 bytes
```
date +%m%d|grep -q 1225&&echo Merry Christmas||!-
date +%m%d|grep -q 1225||!-;echo Merry Christmas
```
Similar to [Mitchell Spector's](https://codegolf.stackexchange.com/a/104609/63348), but use `grep` in silent mode to check for a match, then `&&` will ensure that it only prints on success, and the `||` causes it to look up history with `!-`, which gives me this:
```
-bash: !-: event not found
```
And it stops execution as `!- ; echo foo` demonstrates. The `bash` documentation says that `!-n` refers to the current command minus `n`, so perhaps it is being interpreted as `!-0`, which gives an identical (and non-localised) error message.
]