Req #45173 [Com]: strftime formatting on datetime objects
Edit report at https://bugs.php.net/bug.php?id=45173&edit=1
ID: 45173
Comment by: mail at gh01 dot de
Reported by: peter dot bex at solide-ict dot nl
Summary: strftime formatting on datetime objects
Status: Open
Type: Feature/Change Request
Package: Date/time related
Operating System: N/A
PHP Version: 5.2.6
Block user comment: N
Private report: N
New Comment:
Instead of adding a new method to the datetime classes, maybe the strftime function could accept
datetime objects as second param?
Previous Comments:
------------------------------------------------------------------------
[2008-06-04 12:23:58] peter dot bex at solide-ict dot nl
Description:
------------
1) The regular 'format' method on datetime objects only accepts date() syntax, which is
severely limited in what you can do with it. The strftime syntax is more powerful.
2) As discussed in bug 45167, there's no way to call strftime using datetime object values
reliably, because there are ways to create datetime objects with bogus timezone objects (objects
which can not be recreated nor can their names be passed to date_default_timezone_set).
Because of 1) and 2), there is a need to get strftime integrated in the datetime class.
Reproduce code:
---------------
N/A
Expected result:
----------------
N/A
Actual result:
--------------
N/A
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=45173&edit=1
Thread (4 messages)