Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62727 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48207 invoked from network); 3 Sep 2012 11:54:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Sep 2012 11:54:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=wfitch@meetme.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=wfitch@meetme.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain meetme.com designates 74.125.149.201 as permitted sender) X-PHP-List-Original-Sender: wfitch@meetme.com X-Host-Fingerprint: 74.125.149.201 na3sys009aog109.obsmtp.com Linux 2.5 (sometimes 2.4) (4) Received: from [74.125.149.201] ([74.125.149.201:50930] helo=na3sys009aog109.obsmtp.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/45-20751-D8A94405 for ; Mon, 03 Sep 2012 07:54:53 -0400 Received: from mail-vc0-f170.google.com ([209.85.220.170]) (using TLSv1) by na3sys009aob109.postini.com ([74.125.148.12]) with SMTP ID DSNKUESaipZjJPCpEguioogFs0305xRu6pmQ@postini.com; Mon, 03 Sep 2012 04:54:53 PDT Received: by vcbgb30 with SMTP id gb30so5880464vcb.29 for ; Mon, 03 Sep 2012 04:54:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=GIpHwJEnBrARG8lqEBO1wVbKQS8kyvxVcX94x2iEjtI=; b=ko68IsrnTfx3bBc9sWtY/mhh7LY1U6kjsHln5u3XnRqiv6+bIOjsZ3TRneV6D4Zyc7 Rh+i6EGcOYTSxb5nrD2p24BW28q/SIhT29dEdR1qbzaHMEY3QF5fH+ggZFUY0/WApJ17 UWMFUCvccVhvSiLMidKV24KaKbkDMDYc2DpgXYVXKd2f9ix1f16azgV97b8mssNWW1WX y3POAvR3E8XTRWTHaUsRwC7wn1ph7SME9LlQq5V+t0Ba1g7ybMx5fCOt93LDEbZufS0l YdrnBO3px8FvsCgGHpKS0xSP8fdE/wPahg32Zisy5bCu9AmaoTKxUI191axJwkPKyE2h E+ag== MIME-Version: 1.0 Received: by 10.52.16.212 with SMTP id i20mr9801281vdd.0.1346673289421; Mon, 03 Sep 2012 04:54:49 -0700 (PDT) Sender: wfitch@meetme.com Received: by 10.58.132.161 with HTTP; Mon, 3 Sep 2012 04:54:49 -0700 (PDT) X-Originating-IP: [71.185.163.243] In-Reply-To: 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> Date: Mon, 3 Sep 2012 07:54:49 -0400 X-Google-Sender-Auth: M-0graOuXRzFdSMt9w0An58C_Ms Message-ID: To: Adam Harvey Cc: Andrew Faulds , Ryan McCue , internals@lists.php.net Content-Type: multipart/alternative; boundary=bcaec502d7700b624c04c8cacf25 X-Gm-Message-State: ALoCoQnefJaNO9HpOt2ctXWa6rCZazpTb29M2prjAzfTBTsExY2dSiHW1B7nKOdKMt5KOgsyxGWY Subject: Re: [PHP-DEV] RFC for Adding __toString to DateTime From: willfitch@php.net (Will Fitch) --bcaec502d7700b624c04c8cacf25 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Sep 3, 2012 at 5:45 AM, 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? > > 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. > You absolutely made the case for using DateTime::format() - which is not the proposal here. This is for a string representation of the object via toString. > > No matter what format string you use to iterate over said days. > > Adam > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --bcaec502d7700b624c04c8cacf25--