Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62693 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45539 invoked from network); 2 Sep 2012 21:50:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2012 21:50:49 -0000 Authentication-Results: pb1.pair.com header.from=petercowburn@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=petercowburn@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: petercowburn@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:50127] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/2A-17065-8B4D3405 for ; Sun, 02 Sep 2012 17:50:49 -0400 Received: by vcbgb30 with SMTP id gb30so5370479vcb.29 for ; Sun, 02 Sep 2012 14:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=dSQKYLuBnkd0t6qJKC5bQiwV4rypulMmCSoFJNn/N5k=; b=Pxjn+0TQKaMD790LJ44Jvtx256OX5DE5HmsEpuIwA7Vx55uCabhQWQ0urCIR9WtJMD k9VN97O+QJ+gOxt/Y0PBkHsdZ1z5Oc3jIvqwNElZuqyk6SpAqsQVYk7Q+m4X+5hhOK3K 3Wg0gubnhoKIYEuC0qWWG3fAtv8PeiuEmuJQYlG8utlAe6K3ukWICXOthP3seFxQ9aSF cHTS7OC38QNlT59665pNT4P9woNYJ+HZ3kmcf6YFSpzjaZqWh+OQcs2z8/advVAlFWgT EukSAvtgTfnMgLuCvg6igGXZn3dMV8BKvCQjfLiBxBtMtnWQBNvviAZ2lY+rwZJnsA3c cNBQ== Received: by 10.52.69.174 with SMTP id f14mr8705535vdu.17.1346622645974; Sun, 02 Sep 2012 14:50:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.114.230 with HTTP; Sun, 2 Sep 2012 14:50:05 -0700 (PDT) In-Reply-To: References: <5042BC3C.7070208@sugarcrm.com> <50435ABE.4010308@ajf.me> <50436412.7010802@ajf.me> <5043C3E9.2010105@ajf.me> <5043C5AF.3060701@ajf.me> <5043C74C.8020400@ajf.me> Date: Sun, 2 Sep 2012 22:50:05 +0100 Message-ID: To: Derick Rethans Cc: Andrew Faulds , Benjamin Eberlei , Pierre Joye , Will Fitch , Stas Malyshev , "internals@lists.php.net" Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC for Adding __toString to DateTime From: petercowburn@gmail.com (Peter Cowburn) On 2 September 2012 22:20, Derick Rethans wrote: > > Yeah, I understand you don't see a reason. That's what scares me. For > debugging I definetely wouldn't want to have my datetimes mangled to > just show UTC. I wouldn't even be able to see the difference between 4pm > London and 5pm Amsterdam time! > > cheers, > Derick > Dear Derick et al., *If* you are going to pick a default __toString() format, please, please, please, please, please pick one that a) has *all* of the information stored in a DateTime object, such that b) I can feed that string representation back into the constructor and get an identical DateTime object back. I have yet to see an example in this thread that includes microseconds, for example. And the suggestions to have the GMT offset only is, worrying. The suggestion to have the string always be returned in UTC is also (perhaps more so) of concern. I'm all *for* advocating that folks work with UTC consistently internally in their code, but having the default string representation use UTC regardless of what the DateTime object is representing=85 just, wow. Overall, I'm a big -1 to this whole idea. Finally, why should "echo $datetime;" be expected to work at all, since 95% of the time it's only going to be echo'd plain like that for debugging purposes as we'll never pick the "right" format to use in everyone's code. When needing to set the "default" (read: per-instance) string format with something like setToStringFormat() or whatever, that becomes *more* work than just calling format(). Thank you kindly, Peter