Details
-
Type:
Docs: Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Not an Issue
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Zend_Date
-
Labels:None
-
Language:English
-
Tags:
Description
Hello, documentation at http://framework.zend.com/manual/en/zend.date.basic.html 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...
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?repname=Zend+Framework&path=%2Ftrunk%2Flibrary%2FZend%2FDate.php#l461]).