You are not logged in.
Hey Archers,
I have trouble correct time being displayed in my system.
My BIOS time is:
May 18 2012 08:39:21 PM IST
Date command displays
Sat May 19 02:09:59 IST 2012
Clearly the time displayed by date command is localtime+05:30 (Asia/Kolkata), when I expect it to be just localtime.
How do I correct this?
I dont dual boot and have just Arch installed on my machine.
And my /etc/rc.conf has this:
...
HARDWARECLOCK="UTC"
TIMEZONE="Asia/Kolkata"
...
Please correct if my understanding is wrong, but is this how it works?
When I say HARDWARECLOCK=UTC and TIMEZONE=''Asia/Kolkata",
It assumes, hardwareclock, time displayed by BIOS, is infact UTC, and, since the user is interested in timezone, +0530, it adds 0530 to hardware clock.
Thanks,
Nachiket.
Last edited by Nachiket (2012-05-19 07:22:47)
--Nachiket.
Offline
Offline
I could be wrong -- its been a while since I had a look at the rc.conf file, but I believe that I don't have the HARDWARECLOCK or TIMEZONE listed in rc anymore, I just symlinked my timezone to /etc/localtime.
I'll check tonight ...
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
That wiki has the answers. The problem is your hardware clock is on local time, but you tell arch in rc.conf that it's on UTC, so arch adjusts it accordingly.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Hey Tectu,
The wiki article on Time was indeed splendid. It had all the information I needed. Thank you.
Trilby,
You were right, my hardware clock was on local time.
So this is what I did to set it correct.
1. Set the HARDWARECLOCK to "localtime" in /etc/rc.conf
...
HARDWARECLOCK="localtime"
TIMEZONE="Asia/Kolkata"
...
2. Reboot the system
3. Set the systemclock to UTC by doing a -0530 (minus 05 hours 30 minutes)
# date `date -d "-05 hours -30 mins" +%m%d%H%M%Y`
4. Copy the system clock value to hardware clock
# hwclock --systohc
5. Edit the /etc/rc.conf to set HARDWARECLOCK back to UTC
...
HARDWARECLOCK="UTC"
TIMEZONE="Asia/Kolkata"
...
6. Reboot the system.
And yes, now my system clock displays correct time
Just setting HARDWARECLOCK to "localtime" also worked. But since I the beginners guide recomments "UTC" I did all this.
Marking the thread as SOLVED.
Regards,
Nachiket.
Last edited by Nachiket (2012-05-19 07:23:33)
--Nachiket.
Offline
You may want to consider ntp. You never need to set the clock by hand again
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
I have been searching for this for long. Thanks for the tip.
Offline