Re: RFC for Adding __toString to DateTime

From: Date: Sun, 02 Sep 2012 22:08:00 +0000
Subject: Re: RFC for Adding __toString to DateTime
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  Groups: php.internals 
Request: Send a blank email to internals+get-62694@lists.php.net to get a copy of this message
Peter Cowburn wrote:
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().
Hopefully Will now understands just how problematic his request is, and why it has not been implemented as yet. I'm with you but for a slightly different reason. I never run anything but UTC on the server. So I'm only displaying anything other than UTC when handling a client view of the data. So I would normally be calling format with the client timezone data. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

« previous php.internals (#62694) next »