Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62741 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72414 invoked from network); 3 Sep 2012 13:29:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Sep 2012 13:29:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=adam@adamharvey.name; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=adam@adamharvey.name; sender-id=pass Received-SPF: pass (pb1.pair.com: domain adamharvey.name designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: adam@adamharvey.name X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:62101] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/6A-20751-6D0B4405 for ; Mon, 03 Sep 2012 09:29:59 -0400 Received: by obbwc18 with SMTP id wc18so9921562obb.29 for ; Mon, 03 Sep 2012 06:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamharvey.name; s=google; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=j93lv/Q5A4hbZViQw0ekwyvqZOq+1kKrYXGqZKVrMV0=; b=zPCIyQw4EhdECoNs8qlUPlyCGd6BLAU+7m/yYLtoEbyjDmnl8o2d1SB9QSn5qNNnha qCeUcbMSeu+lJaPgglIbuJ3pufPsQz27YyelT48FMc0tfgwq4m1kr9rW7D3lvIn1RXvT K9PshZlljbs32WNWRbGIVKe+aAJcbjDTHat1g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=j93lv/Q5A4hbZViQw0ekwyvqZOq+1kKrYXGqZKVrMV0=; b=FgPw3CUOgF5+TNdO9X7iW7pYrSNNGfmEVg3UWyw6yEMTm7fwpypV0uA8+gR08JDCx1 6IJjoUf1gjoUgewPwpBJPedeS3cNxehHk4vPQW4UB59E5J9rj0eE0ZWCpzOC0REDLHy0 MXSVahT2C5WaemumtZPH2DJjKky5ZfUYSw/JzgOabr9wFLxxSBdyGc6rdmjLQYGaFzEX 6CfYXulmwihbHXPgXIn9I31l4Pjupkmu7vnwVim8C/Owb75LaOcbJ172ibhQv0I8OAld tcG2yYwP0UUw6lBhJFBSrLdc4emcIngrKBd6X4j2HLvchjpA7/lzKagdWDangcoJEc07 kLdQ== Received: by 10.182.146.46 with SMTP id sz14mr13771415obb.76.1346678996366; Mon, 03 Sep 2012 06:29:56 -0700 (PDT) MIME-Version: 1.0 Sender: adam@adamharvey.name Received: by 10.76.171.131 with HTTP; Mon, 3 Sep 2012 06:29:36 -0700 (PDT) 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 21:29:36 +0800 X-Google-Sender-Auth: HYaPhb41M_ZWwkjgd5bVIluN3VY Message-ID: To: Will Fitch Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlIumAZFz5e/uaYEVdyKEk7mRPDH6qMDbsc0w4icTg2Uxi34h2E6ibqJ6uWStz8Jex7AEzH Subject: Re: [PHP-DEV] RFC for Adding __toString to DateTime From: aharvey@php.net (Adam Harvey) On 3 September 2012 19:54, Will Fitch wrote: > On Mon, Sep 3, 2012 at 5:45 AM, Adam Harvey wrote: >> 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. I understand the proposal. My point is that there's no such thing as a canonical string representation of a DateTime object, and trying to invent one (or worse, provide yet another configuration option for the user to choose one in a manner that isn't consistent from installation to installation) is a pointless exercise. Anyway, since I understand your argument and simply disagree with it, I'll wait for the vote. Adam