On 2 September 2012 22:20, Derick Rethans <der...@php.net> 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… 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php