Is it Time for Milk and Cookies?

Published by romancoding in

Christmas Eve is almost upon us, so naturally we need to prepare some milk and cookies for Santa! Create a function that accepts a PHP DateTime object and returns true if it's Christmas Eve (December 24th) and false otherwise.

Examples

timeForMilkAndCookies(new DateTime("2013-12-24")) ➞ true

timeForMilkAndCookies(new DateTime("2013-1-23")) ➞ false

timeForMilkAndCookies(new DateTime("3000-12-24")) ➞ true

Notes

All test cases contain valid dates.

Watch a quick demo on how Edabit works.