Summer Time & Winter time adjustments

Richard A Downing richard at langside.org.uk
Wed Aug 17 13:18:50 PDT 2005


Declan Moriarty wrote:

> 
> Right now the time is close to 20:00, the BIOS says 20:00 but the lfs
> installations say 21:00. I'm on GMT about half of the year (to be 
> precise, 2/5ths to 3/5ths). The time command is for somebody else -
> somebody who can dial up on pppd directly - that sort of guy. How do I
> shift it back an hour or forward.
> 
> But the various time programs seem broken at best, and linux seems
> confused about clocks, having turf wars over this function & that one.
> 
> [root at genius ~]# hwclock --show
> Wed 17 Aug 2005 20:28:09 IST  -1.008866 seconds
> [root at genius ~]# date
> Wed Aug 17 21:28:19 IST 2005
> [root at genius ~]# gettimeofday
> -bash: gettimeofday: command not found
> 
> I presume that's what inspired ddate :-)
> 
> What's the story? How do I sort that one?

/preamble
Long ago, when even Sligo was unified as part of Great Britain, we had a
little tiff with Germany's Kaiser Bill over who was top nation (America
won, by the way) called by some WW1.  During the tiff, the munitions
workers kept skiving off down the pub, so the Gorvenment brought in
Licensing Hours to make the pubs close when the factories were working
and to make the girls who put HE in shells a little more sober - and
also decided to make the working day longer in the summer by messing
about with the clocks and so invented British Summer Time.
Personally, I think it was the drinking hours that made the Irish
revolting, but there you are.
Later, after Ireland had done the right thing and got a divorce so they
could have their own licensing hours, we had another little shenanigan
with Germany over who was in charge in Europe (America won again!).
During that little affair the Government introduced Double Summer Time,
just to make even more bombs.
/end preamble

The problem you have with Linux and Clocks comes about this-wise:

Sensible Operating Systems, like UNIX, keep their hardware clocks
synchonised to Univeral Coordinated Time (UTC) - which just happens, for
excellent political reasons, to coincide with GMT.  This allows them to
'leave it alone' which is an excellent thing to do with Hardware
anything.  This is known as a Standard.

Sensible Operating Systems then report date and time by applying the
correct offset to the system clock, which might be the hardware clock,
or, more likely a software clock initialised to the hardware clock, or
even a network clock of greater accuracy.

Bill Gates, when writing DOS didn't like standards, because people
wouldn't pay for them (and , of course, because he was a ....). So DOS
kept it's hardware clock in Local time.  When DOS grew old, bloated and
senile and changed it's name to Windows, it kept its hardware clock in
local time.

When Linus and friends were writing Linux, they tried to write a
Sensible Operating System, and so followed the UNIX custom, but knowing
that most Linuxes were going to run on PC's and possibly even dual boot
with DOS/Windows, they came to an 'accomodation' and allowed users to
decide if the hardware clock should be UTC or Local Time.  The decision
you make is recorded in /etc/sysconfig/clock.

Now if you don't run dual boot, and have your /etc/sysconfig/clock
saying so, your BIOS (aka the hardware clock) will be an hour out (in
Ireland, and UK) during summer time.  hwclock reads the hardware clock.
date and most other software use a system call to get the date and hence
gets the one corrected to local time.

Matt is also right, but I'm more entertaining :-)

Richard.
(Irish on my Paternal Grandmothers side)



More information about the blfs-support mailing list