|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41187 DateTime::setDefaultFormat for standard __toString() output of DateTime objects
Submitted: 2007-04-25 15:00 UTC Modified: 2014-01-25 14:26 UTC
Avg. Score:4.5 ± 0.8
Reproduced:9 of 9 (100.0%)
Same Version:2 (22.2%)
Same OS:4 (44.4%)
From: r dot korving at xit dot nl Assigned:
Status: Wont fix Package: Date/time related
PHP Version: 5.2.2RC1 OS: Any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-04-25 15:00 UTC] r dot korving at xit dot nl
it would be nice if a static function DateTime::setDefaultFormat() was added to the DateTime class, which can set a default output format which can be used by DateTime's __toString() - which is also currently non-existing.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-08 07:42 UTC] grodny at oneclick dot sk
This would be nice to implement at least into 5.3 version.
 [2011-02-21 21:02 UTC]
-Package: Feature/Change Request +Package: Date/time related
 [2014-01-25 14:26 UTC]
-Status: Open +Status: Wont fix
 [2014-01-25 14:26 UTC]
This is not something we will add, as it's going to be impossible to decide a format. If you want __toString to work, create an inherited class that implements __toString with you format of choice.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 13:01:29 2024 UTC