3

I have a datetime field in rails and it stores in the right format when I save an object from rails. But when I convert that to the JSON format, it messes the date format:

Format stored in the DB: 2011-04-27 09:18:00 -0400 but when I do JSON of that object it changes the date format to 2011-04-27T09:18:00-04:00

How can I keep the date format consistent?

I'm using render :json => @eventsList to render the object to :json

ed1t
  • 8,719
  • 17
  • 67
  • 110
  • That works: http://stackoverflow.com/questions/5370061/format-date-time-in-find-operation-in-rails-3/7479550#7479550 – hipertracker Sep 20 '11 at 03:00

1 Answers1

0

used the solution at rails dates with json

Community
  • 1
  • 1
ed1t
  • 8,719
  • 17
  • 67
  • 110