At 04:42 -0600 on 07/07/2014, Paul Gilmartin wrote about Re: Local Time conversion to/from UTC Time:

On 2014-07-06, at 23:07, Robert A. Rosenberg wrote:

At 09:10 -0700 on 06/28/2014, Hardee, Chuck wrote about Re: Local Time conversion to/from UTC Time:

I'm looking for information on how local time to UTC, and vice versa, is affected by a locale's Daylight Savings Time state.

Converting UTC to Local time for historical data is no problem so long as you know the DST switch dates for the locale. Switching from local to UTC needs the same info but is harder for the FALL switch date due to the repeat of the 1AM-1:59AM Hour since there are two of them on switch date. If you have a series of time stamps (or no time stamps for 1AM-1:59AM) then you just use a 1:xx time stamp occurring after a much later 1:xx one to mark the switch from ST to DST. For SPRING there will be no 2:xx so anything from 3AM on is ST.

I believe you have that backwards.  In FALL, switch from DST to ST;
in SPRING from ST to DST.

-- gil

OOPS. I might have it backwards but my principle still stands. There only ambiguous time stamp is the switch day when the 1AM hour can occur twice. On that day when you see get to 1:59AM and roll back to 1:00AM again (and thus see timestamps in the 1:xxAM hour earlier than a previous timestamp) you know to adjust the UTC offset. When you skip the 2:xxAM hour then you know to use the correct offset for 12M to 1:59AM and to switch to the other offset when you see 3:00AM.

Reply via email to