On 3 September 2012 19:54, Will Fitch <willfi...@php.net> wrote: > On Mon, Sep 3, 2012 at 5:45 AM, Adam Harvey <ahar...@php.net> 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php