We have changed the ‘to_json’ method in Time so that it’s fast and works automatically when parsing the string (no typecasting).
Without Property
, Time.now.utc.to_json
looks like this out of rails:
"Thu Feb 11 17:50:18 UTC 2010"
With rails you get:
"2010/02/11 17:50:18 +0000"
With Property
, you will have:
{"data":"2010-02-11 17:50:18","json_class":"Time"}
Note that this is the only version where this is true:
t = Time.utc(2010,02,11,17,50,18) t == JSON.parse(t.to_json)