php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #43595 Be able to add a UNIX timestamp to constructor of DateTime
Submitted: 2007-12-14 10:47 UTC Modified: 2007-12-14 22:42 UTC
From: mattis at xait dot no Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5.2.5 OS: Windows XP SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mattis at xait dot no
New email:
PHP Version: OS:

 

 [2007-12-14 10:47 UTC] mattis at xait dot no
Description:
------------
It would be nice if DateTime could accept something like:

$dt = new DateTime(time());

or maybe a method like so:

DateTime::createFromTimestamp(time());


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-14 22:42 UTC] derick@php.net
Fixed by Scott in CVS, but not as a factory method, but rather as the normal method setTimestamp().
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 15:01:32 2024 UTC