Te curious case of DST
Geoffrey Leach
geoff at hughes.net
Wed Nov 21 15:31:50 UTC 2012
On 11/21/2012 06:45:30 AM, Matthew Saltzman wrote:
> On Tue, 2012-11-20 at 15:53 -0500, Tom Horsley wrote:
> > On Tue, 20 Nov 2012 12:04:13 -0800
> > Geoffrey Leach wrote:
> >
> > > Yes it is dual-booted with Windoze. However, I have Linux running
> on
> > > local time for that reason.
> >
> > Doesn't matter. They both try to "fix" the clock the first time
> they
> > are booted after the DST change. There is a flag you are supposed
> > to be able to set to have it not do that, but over a period of
> > many years of DST changes, no flag setting I made in any version of
> > Windows seemed to have any effect.
>
> I believe that's not quite correct.
>
> Linux (at least Red Hat/Fedora) saves the current time in the
> hardware
> clock on shutdown. If the hardware clock is set to local time, it
> assumes the hardware clock is correct on boot. So if Linux is
> running
> at the moment the time changes, it will save the correct time. But
> if
> it is off at the time change, it will not correct the time on boot,
> so
> you have to set the hardware clock manually when you start up. If
> the
> hardware clock is set to UTC, then it will always set the correct
> time
> (according to tzdata).
>
> Windows doesn't touch the hardware clock while running or on shutdown
> (though if it is running at the time change, the system clock will
> correct itself). But it adjusts the time on the first boot after the
> time change. Windows clock does have an option not to adjust for DST,
> but it is set per user.
>
> So you get in trouble if the clock is set to local time and:
> A. Linux is running at the time change and then you boot into
> Windows. Then Linux updates the hardware clock on shutdown
> and
> Windows updates it again on boot.
> B. you're not running Linux at the time change and you boot
> Linux
> first after the time change and forget to reset the hardware
> clock. Then the time is wrong until you boot Windows.
> C. you're not running Linux at the time change and you boot
> Linux
> next and correct the hardware clock when you start, then you
> boot Windows and it corrects the clock again.
> D. some subtle other failure mode I might have missed.
My heavens that's complicated. However, I must confess to B above.
Thanks for the analysis.
More information about the users
mailing list