From: "NARUSE, Yui" Date: 2008-08-03T06:16:28+09:00 Subject: [ruby-core:18091] Re: Suggestion to change Time#to_s format to an official standard FYI, Ruby 1.9 uses another format, "2008-08-03 06:16:10 +0900". Dirkjan Bussink wrote: > Hello people, > > When working with the JSON gem today, I found an annoyance. It currently > uses Time#to_s to create a JSON representation of a Time object. The > problem with this is that not every browser apparently handles this format. > > Because of this, I started to dig into it and found that Ruby's format > of Time#to_s doesn't adhere to any official standard. It looks like UNIX > date output for some locales and also has a resemblance to RFC2822, but > the location of the year differs. > > Is there any reason that Time#to_s doesn't adhere to any standard? It > would probably make the output easier to parse, for example for > browsers, but I think it would be better overall to use a standard here. > > Another related topic is DateTime#to_s. Is the output difference on > purpose here? Or has it never been given any thought? > > I hope some people here could shed some light on this. -- NARUSE, Yui