Hello,
webPragmatist wrote:
>
> I'm having an issue... I can't format using the PHP date() function
> convention when calling $date->toString()
> <br /><br />
> Here's what I have:
> <pre>
> $tokenExpiry = new Zend_Date();
> $tokenExpiry->add(3, Zend_Date::DAY);
> $tokenExpiry->setTimezone($config->application->timezone->out);
> $tokenExpiry->toString('D. d F, Y g:ha O');
> </pre>
> It should just make a day that is three days from now and configure it's
> timestamp. Regular toString() works but when I use the date() param it
> returns:<br /><br />
> 10. 11 F, 2009 g:4PM O
>
if you want to use date() format specifier, you must set
Zend_Date::setOptions(array('format' => 'php')) before.
See:
http://framework.zend.com/manual/en/zend.date.constants.html#zend.date.constants.phpformats
Cheers, Jan
--
View this message in context:
http://www.nabble.com/Zend_Date-and-PHP-datetime-formats-not-working-with-toString%28%29-tp21362428p21368637.html
Sent from the Zend Framework mailing list archive at Nabble.com.