From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Valiquette Subject: Re: system clock... Date: Fri, 01 Oct 2004 15:52:39 -0400 Sender: linux-admin-owner@vger.kernel.org Message-ID: <415DB587.2080609@ieee.org> References: <20041001175313.2156.qmail@web52903.mail.yahoo.com> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-reply-to: <20041001175313.2156.qmail@web52903.mail.yahoo.com> List-Id: Content-Type: text/plain; charset="iso-8859-1"; format="flowed" To: Ankit Jain Cc: admin Ankit Jain a =E9crit : > hi >=20 > i have a problem with my system clock. >=20 > 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? >=20 > if somebody can help or faced this kinda situation? >=20 Typically, it is just a problem between the hardware clock using=20 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=20 software clock. Windows use local time for the BIOS, while Linux=20 normally use UTC. So, if you reboot in Windows, the time will be=20 correct. Since Linux think that the BIOS is in UTC, it set its softwar= e=20 clock with the time it found in the BIOS, and add (or substract) hours=20 depending of the user time zone. "date" set only the software time. "hwclock" is the one used at boo= t=20 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.=20 The simpliest is to just set your software time as you did, and set the= =20 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=20 (probably --localtime) otherwise it is windows that will get the time=20 wrong after the next reboot. If you use only Linux/Unix, I would prefe= r=20 to use --UTC but both works. Finally, it is also possible that your timezone is not properly=20 adjusted in Linux (see tzset), but most people adjust it properly durin= g=20 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