Zend_Date with dates before 1901

Zend_Date

Zend_Date is the Zend Framework module for manipulation of dates. It gives several advantages. Everybody how has dealed with dates knows that built in PHP date function cannot manage dates before 1901. With that kind of problems Zend_Date is pretty fine.

How to do that

If you have only

Zend_Date::set($timestamp);

is not enough. The timestamp is an int representation and the framework cannot get the timezone from that and trows an error.

The simple way to solve the problem

Replace the line above with these:

$date = new Zend_Date($timestamp);

$date->setTimezone(‘Europe/Paris’);

print $date->toString(‘d M y’);

Now everything should be in place.

Leave a Reply

Your email address will not be published. Required fields are marked *