Monday, November 13, 2006

PHP date strtotime Limitation

No Sheep » PHP strtotime Limitation

Faced this problem in PHP 5 when retreiving a datetime value from MySQL using mysql_result results in a proper date. But when I try to format it using date($format, strtotime($dateVal)), the function fails for dates prior to 1970. Online debates on the bug blamed it on the O/S's limitation to represent dates before Linux Epoch (Jan 1, 1970) in signed integer, which seems so lame. Anyway, found this article that works around the issue and fixed the problem for me.


powered by performancing firefox

No comments: