|
|||
|
hello,
there is a strange behaviour of Zend_Date... Code:
$date1 = array('year' => '2008', 'month' =>'4', 'day' =>'13', 'hour' => '10', 'minute' =>'45', 'second' => '12');
$show_date1 = new Zend_Date($date1);
echo $show_date1;
//returns: 2008-04-13 10:45:12
Code:
$date2 = array('year' => '2008', 'month' =>'4', 'day' =>'13', 'hour' => '23', 'minute' =>'45', 'second' => '12');
$show_date2 = new Zend_Date($date2);
echo $show_date2;
//returns: 2008-04-14 23:45:12
'day' = 'day' + 1 can anyone tell me something about this? Code:
echo Zend_Version::VERSION; //returns: 1.5.1 |
|
|||
|
Hi!
I know this doen't help but I have the same problem. I just can't find the code anymore. I had to subtract one hour to get to correct date. Zend_Date is a monster! ![]() I think my problem was, that I reused the same Zend_Date object (which isn't the case in your example) and forgot to level the time correctly. When I find my code I'll post it here. Dave |
|
|||
|
@wudz: Your problem is the timezone in addition with the array syntax. This has been fixed in the latest release.
@thedave: reusing a object you need to give a complete date first before doing any calculations @ewok: Your end-of-month calculation can not work. When adding a month with different daylengths you will have eighter the 31 of the same month or the 1st of the next month... february will brake also all. Just doing a little basic math will show that this can not work as you want. This can be done by adding 1 month, setting 1st of month, substract one day... all oter ways will not work properly.
__________________
Greetings Thomas Weidner I18N Team Leader, Zend Framework http://www.thomasweidner.com |
|
|||
|
Hi all,
I've got a similar problem (but I don't know if it's linked to i18n) : When I try to display the 29th december 2008 I got the 29th december 2009. The code: PHP Code:
Strange ... ZF version : 1.5.3 |
|
|||
|
This is no bug but a feature.
![]() You should read the manual where you find a description of this problem and the reason as also the solution. Zend Framework: Documentation From the manual: Quote:
Sometimes reading the manual really helps. ![]()
__________________
Greetings Thomas Weidner I18N Team Leader, Zend Framework http://www.thomasweidner.com |
![]() |
| Thread Tools | |
| Display Modes | |
|
|