O'Reilly logo

Core PHP Programming, Third Edition by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

14.1. Time and Date

All the time functions work off the UNIX epoch, which is January 1, 1970. Dates are expressed as seconds since the epoch. This makes it easy to refer to dates with integers. When a function calls for seconds since the epoch, I've referred to it as a timestamp.

Windows accepts timestamps from zero to the largest 32-bit integer, which corresponds to January 19, 2038. UNIX allows for negative timestamps, which stretch back to December 13, 1901.

boolean checkdate(integer month, integer day, integer year)

The checkdate function (Listing 14.1) returns TRUE if a date is valid, and FALSE otherwise. A day is considered valid if the year is between 0 and 32767, the month is between 1 and 12, and the day is within the allowable days ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required