The documentation states to use the ISO constant when working with Database
values.
Try:
$date = new Zend_Date ($mysqlDate, Zend_Date::ISO_8601);
Greetings
Thomas
I18N Team Leader
----- Original Message -----
From: "Mathew Byrne" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, July 26, 2007 8:40 AM
Subject: [fw-general] Formatting MySQL Dates with Zend_Date
I seem to having issues with the following code:
Zend_Date::setOptions(array ('format_type' => 'php'));
$date = new Zend_Date ($mysqlDate);
echo $date->toString ('F j, Y, g:i a');
Now if $mysqlDate is equal to '2007-07-25 13:55:49' then the output is
'July 25, 2007, 12:00 AM'.
The date component is clearly correct, but Zend_Date seems to have
difficulty with the time part. Is this something that Zend_Date is not
designed to do? Can anyone suggest another transparent method for
formatting these dates?