You are not logged in.
I'm not sure how or why this started occuring (maybe after an upgrade? cannot trace it to anything specific), but everytime I boot/reboot my laptop/netbook, I find that the time is incorrect. Right now, it shows 1:56am even though the correct time should have been 5:56am (EDT).
Edit: I think it saves the clock incorrectly while halting, as everytime I reboot, fsck complains about time being incorrect while it is mounting the filesystems.
Edit 2: The time in my bios is the same as the time that hwclock reports below.
Here are some output that I think may be relevant; please let me know if you need more --thanks so much for your help in advance...
$ hwclock -r
Sun 29 May 2011 05:58:14 AM EDT -0.798014 seconds # this is correct
$ date
Sun May 29 01:58:36 EDT 2011 # this is incorrect
$ cat /etc/rc.conf | grep CLOCK
HARDWARECLOCK="UTC"
$ cat /etc/rc.conf | grep TIME
TIMEZONE="America/New_York"
$ cat /etc/ntp.conf # I removed the commented lines; I have ntpd in my rc.conf as a daemon
server pool.ntp.org
restrict default nomodify nopeer
restrict 127.0.0.1
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
I keep doing "hwclock -s" after every boot...
Again, thanks in advance
Last edited by vajorie (2011-05-30 04:56:57)
Offline
Vajorie,
Try changing HARDWARECLOCK="UTC" to HARDWARECLOCK="localtime" in your /etc/rc.conf, reboot and see if this fixes your problem.
Cheers
Offline
Vajorie,
Try changing HARDWARECLOCK="UTC" to HARDWARECLOCK="localtime" in your /etc/rc.conf, reboot and see if this fixes your problem.
Cheers
Using "localtime" is discouraged.
https://wiki.archlinux.org/index.php/Rc.conf
@ vajorie
I think that you use UTC for some reason (EDT = UTC -4, right?).
What does 'hwclock --debug' show?
Last edited by karol (2011-05-29 10:46:06)
Offline
Karol,
Sorry, didn't realize it was discouraged. Here, I have to run on 'localtime' because Indonesia doesn't follow DST and if I run 'UTC' my clock is off by 1 hour every April until October :-(
Offline
Karol,
Sorry, didn't realize it was discouraged. Here, I have to run on 'localtime' because Indonesia doesn't follow DST and if I run 'UTC' my clock is off by 1 hour every April until October :-(
In this case you should set your clock to UTC and make the changes manually: https://wiki.archlinux.org/index.php/Rc … calization (the first note).
Offline
@ vajorie
I think that you use UTC for some reason (EDT = UTC -4, right?).
What does 'hwclock --debug' show?
Yes, I think so:
$ hwclock --debug
hwclock from util-linux 2.19.1
Using /dev interface to clock.
Last drift adjustment done at 1305618990 seconds after 1969
Last calibration done at 1305618990 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/05/29 07:22:53
Hw clock time : 2011/05/29 07:22:53 = 1306668173 seconds since 1969
Sun 29 May 2011 07:22:53 AM EDT -0.456159 seconds
PS. For Karol, wouldn't that be considered a bug in tzdata ( http://www.twinsun.com/tz/tz-link.htm )?
Offline
Why don't you have hwclock set to UTC (like you have in your rc.conf)?
[karol@black ~]$ LC_ALL=C hwclock --debug
hwclock from util-linux 2.19.1
Using /dev interface to clock.
Last drift adjustment done at 1304889660 seconds after 1969
Last calibration done at 1304827834 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/05/29 11:45:21
Hw clock time : 2011/05/29 11:45:21 = 1306669521 seconds since 1969
Sun May 29 13:45:21 2011 -0.844813 seconds
(I used 'LC_ALL=C' to print the info in English, the time is the same with or w//o it).
Both 'date' and 'hwclock -r' show correct local time: CEST = UTC +2.
[karol@black ~]$ LC_ALL=C hwclock -r
Sun May 29 13:50:02 2011 -0.445952 seconds
[karol@black ~]$ LC_ALL=C date
Sun May 29 13:50:09 CEST 2011
[karol@black ~]$ grep -i -e clock -e timezone /etc/rc.conf | grep -v ^#
HARDWARECLOCK="UTC"
TIMEZONE="Europe/Warsaw"
Last edited by karol (2011-05-29 11:47:20)
Offline
ntp runs fine without hwclock so you can blacklist the hwclock in rc.conf
Rauchen verboten
Offline
Why don't you have hwclock set to UTC (like you have in your rc.conf)?
I think this fixed it. Rebooted twice, once with the laptop plugged in and once unplugged, and the clock stays the same so far. Thanks! I'll come back and label it as fixed if the thing doesn't come back to haunt me again
ntp runs fine without hwclock so you can blacklist the hwclock in rc.conf
I wanted to know what the problem was being caused by. (If I am now,) I wasn't being affected by the hwclock v ntpd conflict until recently. I wonder what I did to set hwclock to local time (or, rather, if I did something; I didn't know hwclock could be set by UTC or localtime and that setting it to localtime could cause a problem).
Last edited by vajorie (2011-05-29 17:54:47)
Offline
@vajorie: If you are dual-booting with Windows, the it is possible to make Windows use UTC https://help.ubuntu.com/community/Ubunt … 0use%20UTC . This will make Windows not touch the hardware clock at all and therefore you may have to set the hardware cloack to correct UTC time using ntp and hwclock manually.
sudo ntpd -qg & # https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon#Syncing_the_clock_without_running_the_daemon
sudo hwclock --utc --systohc # Set HW clock to UTC and sync it with System Software time as the standard
sudo hwclock --show # to check the time
Last edited by skodabenz (2011-05-29 19:01:29)
My new forum user/nick name is "the.ridikulus.rat" .
Offline
@vajorie: If you are dual-booting with Windows, the it is possible to make Windows use UTC https://help.ubuntu.com/community/Ubunt … 0use%20UTC . This will make Windows not touch the hardware clock at all and therefore you may have to set the hardware cloack to correct UTC time using ntp and hwclock manually.
sudo ntpd -qg & # https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon#Syncing_the_clock_without_running_the_daemon sudo hwclock --utc --systohc # Set HW clock to UTC and sync it with System Software time as the standard sudo hwclock --show # to check the time
Thanks Skoda, but this is an arch-only install
Offline