This project is archived and is in readonly mode.
TimeWithZone#to_json should include time zone
-
Geoff Buesing
- Assigned user set to Rick
This is a good catch -- we should make the output of #to_json consistent across Time, DateTime, and TimeWithZone instances.
The outstanding question is, is there a reason to output json times in UTC?
In the changeset that added ActiveSupport.use_standard_json_time_format, Time is converted to UTC before being serialized, whereas DateTime is not:
http://dev.rubyonrails.org/chang...
ISO 8601 allows time zone offsets other than UTC:
http://en.wikipedia.org/wiki/ISO...
...so I'm not sure why Time #to_json is outputting UTC right now.
Rick?
-
Daniel Morrison
My thought is simply that including the offset gives you more meaningful data, and you can easily convert to UTC if you want it.
-
Rick
I thought it was pretty common practice to use UTC. But if this is what the people want, then so be it!
-
Rick
- State changed from new to resolved
