php.net |  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
Votes:10
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
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: r dot korving at xit dot nl
New email:
PHP Version: OS:

 

 [2007-04-25 15:00 UTC] r dot korving at xit dot nl
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] jani@php.net
-Package: Feature/Change Request +Package: Date/time related
 [2014-01-25 14:26 UTC] derick@php.net
-Status: Open +Status: Wont fix
 [2014-01-25 14:26 UTC] derick@php.net
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 Apr 24 14:01:30 2024 UTC