Issues

ZF-12043: print new Zend_Date(); does not print timestamp but a formatted date

Issue Type: Docs: Improvement Created: 2012-02-06T10:07:52.000+0000 Last Updated: 2012-02-25T18:21:09.000+0000 Status: Closed Fix version(s): Reporter: Michal Novotny (clime) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Date

Related issues: Attachments:

Description

Hello, documentation at http://framework.zend.com/manual/en/… says this

$date = new Zend_Date();

// Output of the current timestamp print $date;

I tried it and it printed a formatted date, not a unix timestamp as I had expected. Btw. idk why this box keeps shrinking as I am typing...

Comments

Posted by Adam Lundrigan (adamlundrigan) on 2012-02-25T18:21:00.000+0000

I think the wording of that section is just misleading. To me it's saying it gets the UNIX timestamp from time() if no constructor arguments are passed, not that it returns one when you print it. The word "timestamp" refers to the act (ie: stamping an item with the current date/time) and not to the formatting. If i'm reading the code correctly, the default behaviour of Zend_Date is to print a date/time string formatted based upon the locale set (See {Zend/Date.php L461|http://framework.zend.com/code/blame.php/…]).

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts