#40171 [Opn->WFx]: There should be a way to create DateTime object from UTC timestamp.
| From: | derick@php.net | Date: | Fri, 19 Jan 2007 18:25:09 +0000 |
| Subject: | #40171 [Opn->WFx]: There should be a way to create DateTime object from UTC timestamp. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-107789@lists.php.net to get a copy of this message | ||
ID: 40171
Updated by: derick@php.net
Reported By: rkumar at msgme dot com
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 5.2.0
New Comment:
That would be too confusing, as PHP auto casts and "20070119" is
something quite different from the unix timestamp 20070119. What you
can do is pass this to the ctor: "@20070119" - the @ makes it interpret
as a Unix timestamp.
Previous Comments:
------------------------------------------------------------------------
[2007-01-19 16:27:05] rkumar at msgme dot com
Description:
------------
The constructor for DateTime object currently takes a string
as a parameter. In most of the scenarios that I have encountered I need
to create a DateTime object from UTC timestamp. Can the constructor be
changed to accept string or integer?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40171&edit=1