Reputation: 2821
Zend_Date function returns the value "Feb 10, 2012" . It supposed to return "Oct 2, 2012". If a give the day greater than 12 than it returns the currect output. I don't know what I was missing. Please help me.
Thanks
Upvotes: 1
Views: 437
Reputation: 21937
If your format is YYYY-MM-DD (2012-10-02), try this code:
$str = '2012-10-02';
$date = new Zend_Date($str, Zend_Date::YEAR . '-' . Zend_Date::MONTH . '-' . Zend_Date::DAY);
echo $date->toString();
Upvotes: 1
Reputation: 1606
What is the code you are using to call the function?
Different countries use different date formats. Some use dd/mm/yyyy others use mm/dd/yyyy. The order you are passing in the day and month are different from the way the function expects to be called.
Try reversing the month and day before you call the function.
Upvotes: 0