Thread: Zend_Date bug?
View Single Post
  #2 (permalink)  
Old 04-02-2008, 10:53 AM
loloziberlo loloziberlo is offline
Junior Member
 
Join Date: Jun 2007
Location: Barcelona
Posts: 8
Default

Quote:
Originally Posted by BobiKK View Post
Code:
$date = new Zend_Date('31.12.2007', 'dd.MM.YYYY');
echo $date."<br />";
echo $date->toString('YYYY-MM-dd');
And the output is:
Dec 31, 2007 12:00:00 AM
2008-12-31

Am I doing something wrong?
For dates like 30.12.2007 and 31.12.2010 the output is correct: 2007-12-30 and 2010-12-31 respectively.
instead of $date->toString('YYYY-MM-dd') use $date->get('YYYY-MM-dd');
__________________
------------------
Loris Candylaftis
Reply With Quote