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

Re: Strange problems with clock

On Tue, 2 Nov 1999, Danish wrote:

> Hello everyone,
> Yesterday I started having strange problems with the Linux system clock (i.e.
> the one the date command returns) on my Multia. It returns totally random
> values, always in the range of January 1970, but all other values random.
> Strangely enough, the BIOS hardware clock is perfectly intact, as hwclock
> returns sane (correct) values.
> Even if I try to put a value into the system clock (with date --set="foo" or
> hwclock --hctosys), the random values are still returned. This is evidenced in
> other programs (apt for example thinks I'm downloading at 0B/s) and getty
> refuses to work, with the returned message "Alarm clock". I'm not sure what
> that message is supposed to mean.

What I think has happened (to all of us) is that the "date" program has
been silently changed to correspond more with "date" on several
other versions of System V.  That is, if you type "date 11030930" it will
reset the system clock for you.  The -s flag now sets the clock <string>
number of seconds ahead of the current setting; thus every time you type 
"date -s 11030930" you add some 127 days to the current time.  If you do
this with a longer string including the year as well, you may end up in
the next century, and if it's beyond 2038, you end up in 1915, or something.

I've been using Debian for several years now, and I'd always used the -s
flag to reset the date, so this came as a surprise--and a fairly vexing
one, too, since the incorrect timestamp breaks make, package building, and
several other things.  It's simple enough to relearn "date", though :-)

John Chapman        hannes@eskimo.com       hannes@pop.nwnexus.com

Reply to: