Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62720 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33110 invoked from network); 3 Sep 2012 09:55:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Sep 2012 09:55:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; 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:35948] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/92-20751-77E74405 for ; Mon, 03 Sep 2012 05:55:03 -0400 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id D8EDC10D63C; Mon, 3 Sep 2012 10:54:59 +0100 (BST) Date: Mon, 3 Sep 2012 10:54:59 +0100 (BST) X-X-Sender: derick@whisky.home.derickrethans.nl To: Adam Harvey cc: Andrew Faulds , Ryan McCue , internals@lists.php.net In-Reply-To: Message-ID: References: <50435ABE.4010308@ajf.me> <50436412.7010802@ajf.me> <5043C3E9.2010105@ajf.me> <5043C5AF.3060701@ajf.me> <5043C74C.8020400@ajf.me> <5043D8C0.3020802@lsces.co.uk> <5044715E.3050504@rotorised.com> <88183ff3-8037-44da-b6f9-975739600cc8@email.android.com> 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 Mon, 3 Sep 2012, Adam Harvey wrote: > On 3 September 2012 17:36, Andrew Faulds wrote: > > Ryan McCue wrote: > >>What about ISO8601 with the Olson timezone suffixed? > >> > >> 2012-09-02T18:17:36+0100 (Europe/London) > >> 2012-09-02T18:19:05+0100 (Africa/Niamey) > >> > > > > Sounds good. > > If we're going to invent arbitrary non-standard formats, why don't we > just tell people to use json_encode($dateTime) and be done with it? That, or just call ->format() on the DateTime object! > I just don't see how we can choose a sensible default format for > users. Sometimes you want ISO 8601. Sometimes you want whatever your > locale's customary date format is. Sometimes you want US m/d/y dates > for interacting with legacy systems. RFC 2822. RFC 822, natch. And so > on. I don't see why one format should be blessed over others and have > magic behaviour when a DateTime object is cast to a string. IMO, the > fact that users have to provide a format string and call format() is a > good thing: explicit beats implicit, every day of the week. > > No matter what format string you use to iterate over said days. +1 cheers, Derick