From: Simon Valiquette <v.simon@ieee.org>
To: Ankit Jain <ankitjain1580@yahoo.com>
Cc: admin <linux-admin@vger.kernel.org>
Subject: Re: system clock...
Date: Fri, 01 Oct 2004 15:52:39 -0400 [thread overview]
Message-ID: <415DB587.2080609@ieee.org> (raw)
In-Reply-To: <20041001175313.2156.qmail@web52903.mail.yahoo.com>
Ankit Jain a écrit :
> hi
>
> i have a problem with my system clock.
>
> whenever i reboot or start my system my clock is
> incremented by around 6 hrs. after that its alright
> i.e if i correct the time it dosent mis behave but i
> dont know whats wrong in reboot or booting the sys?
>
> if somebody can help or faced this kinda situation?
>
Typically, it is just a problem between the hardware clock using
local time and the kernel using UTC (Greenwich time) or the opposite.
You have to know that there is a hardware clock (in the BIOS) and a
software clock. Windows use local time for the BIOS, while Linux
normally use UTC. So, if you reboot in Windows, the time will be
correct. Since Linux think that the BIOS is in UTC, it set its software
clock with the time it found in the BIOS, and add (or substract) hours
depending of the user time zone.
"date" set only the software time. "hwclock" is the one used at boot
time to set the software clock.
Try this as root (or pick a look at /etc/adjtime ):
hwclock --utc
hwclock --localtime
It shows the time of your BIOS, and one of them is probably good.
The simpliest is to just set your software time as you did, and set the
hardware clock the way you want (UTC or local time).
hwclock --utc --systohc
hwclock --localtime --systohc
If you use Windoze, takes what works from the previous commands
(probably --localtime) otherwise it is windows that will get the time
wrong after the next reboot. If you use only Linux/Unix, I would prefer
to use --UTC but both works.
Finally, it is also possible that your timezone is not properly
adjusted in Linux (see tzset), but most people adjust it properly during
Linux installation.
Simon Valiquette
http://www.gulus.org
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2004-10-01 19:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-01 17:53 system clock Ankit Jain
2004-10-01 18:03 ` J. David Boyd
2004-10-01 18:04 ` Kurt Wall
2004-10-01 19:52 ` Simon Valiquette [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=415DB587.2080609@ieee.org \
--to=v.simon@ieee.org \
--cc=ankitjain1580@yahoo.com \
--cc=linux-admin@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).