Ceol
1/30/2006 8:55:00 AM
My understanding is that a time change is implemented by switching time
zones; you change from Pacific Standard Time to Pacific Daylight Time.
Pacific Standard Time would continue to have the same offset in July as it
would in January; it's just that in July no clocks are set to Pacific
Standard. (Except the clock on my kitchen scale, of course...)
And good luck figuring out when you're supposed to switch; it's arbitary,
set by legislation, not by something you can figure out. And the US at
least will be changing in the near future. And there are places that never
make the switch, too. Google for things like 'daylight savings time zone'
and you'll get an idea of the pain involved.
- James
<easleydp@gmail.com> wrote in message
news:1138565845.900427.111410@g14g2000cwa.googlegroups.com...
>I don't seem to be able to correctly calculate the time offset between
> two time zones when daylight saving is in effect. The code below
> demonstrates that Ruby knows about daylight saving, but I get the wrong
> answer when I calculate the offset.
>
> BTW, yes, I know I can use Time#utc_offset, but I believe that depends
> on me actually being in that timezone. I'm looking for a way to
> calculate the offset between two arbitrary timezones, neither of which
> is my local timezone.
>
> Thanks for any help.
>
> David