You are not logged in.
Hi, guys,
I have been puzzled by time setting in GNU/Linux for long. On a recent installing on my laptop, I got it wrong again. I can't retain it any more. I want some *clear* explanation. I have read man pages of date, hwclock, rc.conf, wikis in our site, but well, I am just confused. Here is my settings in rc.conf
HARDWARECLOCK="UTC"
TIMEZONE="Asia/Macau"
But the system clock is always wrong. `date` always gives time 8 hour fast. I know what arch does with hardware and system clock when it boots or shutdown. What I can't understand is that why the TIMEZONE info seems totally ignored. In my case, it should be UTC+8, but it seems that when the system boots, it just copies the hardware time to system, without taking the timezone info into account at all. I met this issue in almost every Linux distro I tried. Doesn't the TIMEZONE settings means "[+/-]x hours" to UTC? Thanks.
Last edited by plmday (2010-05-13 08:32:52)
Arch, the Portal of Linux
Offline
install ntp
Offline
Offline
@falconindy
Yes, I am not dual booting Win. `hwclock` shows time at UTC, the same with `date`
@thisllub
I know ntp could solve the problem itself, but I am wondering why my solution doesn't work
Last edited by plmday (2010-05-12 11:23:26)
Arch, the Portal of Linux
Offline
You might try removing
/var/lib/hwclock/adjtime
and rebooting.
Offline
Is your system time set correctly? Check it in your BIOS.
Offline
Your TZ variable may be incorrect:
echo $TZ
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
install ntp
NTP is not the solution for these kinds of problems, and it wasn't designed for these kinds of problems. NTP is for syncing by making small adjustments, it's not supposed to handle timezones or big adjustments. Suggesting to use NTP isn't a good idea for these cases nor is it a real solution. The only time you should suggest someone use NTP is if their clock always seems to not stay in time.
As for the timezone issue, when I did have my hwclock set to UTC, I had no problems with the timezone being taken into account (-5 or -4). Removing /var/lib/hwclock/adjtime would be the first thing I would try, otherwise I'd edit rc.local and add the line:
hwclock --utc
Offline
Thanks, guys. I set the system clock using `date` last night before I went to bed. And today when I boot, the time display is right now,
Arch, the Portal of Linux
Offline
I'm not sure if it will stay that way. Falconindy didn't ask you if you were dual booting windows just out of curiousity.
Windows sets your system clock to local time (did so at least up to XP, not sure about Vista/windows 7). That ruins your settings when using utc. I think you have to use HARDWARECLOCK="localtime" when dual-booting windows.
Edit:
changed 'local' to 'localtime'
Last edited by leepesjee (2010-05-13 12:03:21)
Offline
@leepesjee, he said he wasn't dual booting, but yeah windows xp sets hwclock to local time. I've heard, however, there's a way to change that.
http://weblogs.asp.net/dfindley/archive … 2900_.aspx
Haven't tried it since I rarely go into Windows. Should probably get to it. Would love to set my clock back to utc.
Offline
A me bad, did not read carefully. Sorry for the bother.
Offline