0

I'm having an issue with time zone.

I've put

config.time_zone = 'Eastern Time (US & Canada)'
config.active_record.default_timezone = 'Eastern Time (US & Canada)'

In my application.rb file, and for the most part it handles the time correctly - everywhere except for in a form. For some reason, it shows the UTC time in the form, and you have to enter the time in UTC. Everywhere else (including if I output the time right above the text field for debugging), it shows it in the correct local time, although it does still show the -0400, which I'd also like to hide. Outputting the time on the page gives me: "2012-04-07 02:35:00 -0400" But in the form, it shows up as "2012-04-07 06:35:00.000000"

Any thoughts on why it is showing differently in the form?

Josh Johnson
  • 563
  • 3
  • 11
  • 29

1 Answers1

0

Have you tried Time.now.in_time_zone instead of just Time.now, see this related question

Community
  • 1
  • 1
0x4a6f4672
  • 27,297
  • 17
  • 103
  • 140