1

Running this code...

Time.use_zone('Pacific Time (US & Canada)') do
  p Time.zone.now
end 

I get the following: => Sun, 14 Apr 2013 20:30:53 PDT -07:00

Yet when I do Rails Time Zone Select.... it says -8:00 quite clearly. Why is it -7 in one area and -8 in another?

Other times, time zones like Hawaii which are -10:00 don't get offset by an hour.

I assume this has something to do with DST, but I'm more curious whether it means it's working properly or improperly and there is something else I need to do.

Ultimately I'm using this in a datepicker, and I find it very odd that when I use Time.zone.parse (along with my time zone around filter), its offsetting everything by 1 hour.

THanks

4

0 回答 0