From: Jeremy Evans Date: 2010-02-19T12:31:21+09:00 Subject: Re: Convert Sequel Dataset to JSON Object Phil Tayo wrote: > Now my problem is with the to_json function. I have a created_at field > in the DB of type datetime and the to_json function seems to be > splitting it up and formatting it weirdly, here's the result of my json > object: > > [{"country":"uk","task":"qwdwd","created_at":{"json_class":"Time","n":407000000,"s":1266543411},"id":3}] > > I'll have to look into this when I have more time. You probably want to add Time#to_json to do something, maybe to_s.to_json or strftime(...).to_json. Jeremy -- Posted via http://www.ruby-forum.com/.