I’m trying to generate a simple calendar, at any years (between 2000 and 2100). And date() is limited before 2038. Does anyone know a simple replacement for it?
If you're on PHP 5.2+, use a DateTime object. <?php $date = new DateTime('2000-01-01'); $date->modify('+147 years 8 months 21 days 12 hours 46 minutes 22 seconds'); echo $date->format('r') . "\n"; ?> PHP: joebert@frankenstien:~/Desktop$ php -f _.php Fri, 22 Sep 2147 12:46:22 -0500 Code (markup):
That's what they though in the 70's & 80's about the year 2000. Or do you believe in the 2012 conspiracy?
I'd go with the DateTime object like joebert said. date() doesn't go past 2038 because it's dependent on the unix timestamp. On January 19th at 3:14 am, the unix clock (which is kept in binary) will read all 1's, then it will reset to 0's.