Issues

ZF-3185: Allow formating a date on the fly (static method) via Zend_Date

Issue Type: New Feature Created: 2008-04-27T10:35:17.000+0000 Last Updated: 2012-11-20T20:53:16.000+0000 Status: Closed Fix version(s): Reporter: Ben Scholzen (dasprid) Assignee: None Tags: - Zend_Date

Related issues: Attachments: - Zend_Date.patch

Description

Most of the time, you simply want to just format a date for the output, without struggling around with Zend_Date. Currently you have to do two steps to get that:

$date = new Zend_Date($myUnformattedDate); echo $date->get(Zend_Date::DATE_FULL);

With my patch, you can do that with a single step:

echo Zend_Date::format($myUnformattedDate, Zend_Date::DATE_FULL);

Comments

Posted by Thomas Weidner (thomas) on 2008-04-27T11:05:42.000+0000

The patch is errorous.

Actually the complete API is object based because it's intention was to be used by date math with fluid interface.

Having same functionality in strict interface could lead to misuse. We will have to look over the cons before we integrate such functionality.

Also WHEN strict functions beside the actual ones are integrated this has to be done for all generic usable functions.

The biggest actual NEG is that the API of Zend_Date is already very big because of it's simplicity and usability. The original intention was not to add functionality until the minimum requirements have been raised and we are able to use the new date extension which is available since PHP 5.2.0.

Posted by Rob Allen (rob) on 2012-11-20T20:53:16.000+0000

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.

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