Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62677 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3271 invoked from network); 2 Sep 2012 17:20:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2012 17:20:39 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:51211] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/A1-17065-76593405 for ; Sun, 02 Sep 2012 13:20:39 -0400 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 68012DE13E; Sun, 2 Sep 2012 18:20:36 +0100 (BST) Date: Sun, 2 Sep 2012 18:20:36 +0100 (BST) X-X-Sender: derick@whisky.home.derickrethans.nl To: Andrew Faulds cc: Benjamin Eberlei , Pierre Joye , Will Fitch , Stas Malyshev , "internals@lists.php.net" In-Reply-To: <50436412.7010802@ajf.me> Message-ID: References: <5042BC3C.7070208@sugarcrm.com> <50435ABE.4010308@ajf.me> <50436412.7010802@ajf.me> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] RFC for Adding __toString to DateTime From: derick@php.net (Derick Rethans) On Sun, 2 Sep 2012, Andrew Faulds wrote: > On 02/09/12 14:40, Benjamin Eberlei wrote: > > I think allowing to change teh default format would be horrible. If > > libraries (such as Doctrine would) use this internally, they are at the will > > of users not to fiddle with this setting. Not to speak about libraries that > > contradict each other. > > > > If there was a format, it would have to be constant imho. > > Then ISO8601, please. It's a single, unambiguous Date and Time format. No it's not unambigious: $ php -r 'date_default_timezone_set("Europe/London"); echo date_create()->format(DateTime::ISO8601), "\n";' 2012-09-02T18:17:36+0100 $ php -r 'date_default_timezone_set("Africa/Niamey"); echo date_create()->format(DateTime::ISO8601), "\n";' 2012-09-02T18:19:05+0100 vs: $ php -r 'date_default_timezone_set("Africa/Niamey"); echo date_create("2012-12-31")->format(DateTime::ISO8601), "\n";' 2012-12-31T00:00:00+0100 ^^^^^ $ php -r 'date_default_timezone_set("Europe/London"); echo date_create("2012-12-31")->format(DateTime::ISO8601), "\n";' 2012-12-31T00:00:00+0000 ^^^^^ cheers, Derick