Hi.
This code example:
<?php
require_once 'Zend/Date.php';
$time = 1262476800;
$date = new Zend_Date(null, null, null);
$date->setTimestamp($time);
echo $date->toString('Y-d-m');
echo '<br>';
echo date('o\-j\-i', $time);
echo '<br>';
echo gmdate('o\-j\-i', $time);
echo '<br>';
echo date('Y-d-m', $time);
gives:
2009-3-00
2009-3-00
2009-3-00
2010-03-01
expected result is 2010-03-01. The whole year is missed :)
I noted that Zend_Date::toString() method with 'Y-d-m' format gives wrong
result in some cases. Then I debugged and saw that ISO 'Y-d-m' is converted
to 'o\-j\-i' and PHP date() function is called - which also gives wrong
result.
Is this a bug or I'm missing something? And if yes, is it PHP bug or ZF bug?
Regards,
Saša Stamenković
--
View this message in context:
http://www.nabble.com/Zend_Date-error-in-conversion-from-timestamp-tp26073816p26073816.html
Sent from the Zend Framework mailing list archive at Nabble.com.