[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: daylight savings time: POSIX vs real world



[ Please don't Cc: public replies to me. ]

jwalther@citytel.net:
> That would certainly explain it.  How does linux need to be changed to
> handle this case?  If it can tell whether it is in UTC or not, it could
> figure out from the time zone how to handle daylight savings time.

The problem with the BIOS clock being in local time is that Linux
can't know whether it has been set to daylight savings time or not.
Someone else (you or Windows, for example) might have set it already.
Linux always assumes that if the BIOS clock is in local time, then
someone else will set the BIOS clock when daylight savings time begins
or ends. While Linux is running, it should still get it right, since
the BIOS clock is read at startup and ignored after that, and since
Linux internally keeps UTC.

If Linux set the BIOS clock itself, things would still break. This
seems to happen if you use both Windows95 and Windows NT -- both
will ask you if it is OK to set the clock after daylight savings
time has begun or ended. So your clock will be off by one hour.

As long as the BIOS clock is kept in anything but UTC, things will
break, since it is essentially an unsolvable problem. With UTC,
there's a chance of everything working reliably.

> In the meantime how can I switch to UTC?  I like to have local time
> available on my system (Im rather far from Greenwhich) too, so will the
> date command still display my local time even if Im using UTC?

You change to UTC by setting your BIOS clock to UTC (from the
BIOS setup screen is probably the simplest way to get it right,
but it can be done from within Linux with clock(8)), and then
setting the GMT variable in /etc/init.d/boot to "-u". If your
timezone is configured correctly, that should be it. After this,
everything Just Works (unless the time is out of joint). The date
command shows local time, unless you ask it to show UTC.

-- 
Please read <http://www.iki.fi/liw/mail-to-lasu.html> before mailing me.
Please don't Cc: me when replying to my message on a mailing list.


Attachment: pgp3iUT6qGVDM.pgp
Description: PGP signature


Reply to: