LQ Newbie
Registered: Sep 2005
Posts: 5
Rep:
|
setting the system time
every so often with linux, i find some issue that makes me feel like a newbie again.
why is it so complicated to set the time in linux?
actually, for years ive struggled every time the UTC vs. local time
question was asked during the installation of suse.
i always used to dual boot windows and so it was easy to just decide
to use localtime.
now, having used gentoo a couple years, i finally decided to try to
use UTC (especially since i read somewhere that not using it can
screw up emerges of certain things sometimes?).
i thought i was fine. i installed gentoo after setting the time to UTC
in the bios. i selected UTC in my /etc/conf.d/clock. i set my local
time zone correctly to America/New York in gnome, and i setup the
time zone during installation as it asked.
i just made sure my winxp dual boot didn't synchronise time on the
internet, and hid the clock in the system tray to avoid confusion.
then i made the mistake of trying out napster for the hell of it.
it told me my clock was wrong, and it would reset it for me or not
let me in (due to encryption/security issues i guess). i still just
had to try it, so i let it do so, figuring i'd uninstall it later
and just set the time back properly in linux again when i was done
messing around.
here i am. i always forget how complicated little things like this
can be. i first tryed setting the clock with date to the current
time for my timezone. in gnome, the clock looked correct again.
then i rebooted, and it didn't resync with hw clock.
well, after refreshing myself on the use of hwclock, i have now
at least learned that /etc/conf.d/clock seems to consist essentially
of parameters to the hwclock command during startup. and it allows
setting whether to sync to hw again on reboot. all fine.
in my case, i had not told it to sync the clock, which explains
why i didn't see the message about syncing clock on reboot,
and why i currently had a problem due to it not syncing the time
i set with the date command.
but, after mulling over the various means to make my clock correct
again, i decided that i would just use the bios to set it to
UTC manually. that seemed the easiest way... until i was actually
in the bios to do it. i realized then, of course, that i didn't
have internet, and being the typical techno-moron who relies on
technology to do everything short of tying my shoes, i didn't know
how to convert local time back to UTC. Even now that i know after
rebooting again, that UTC is 5 hours ahead EST, i don't trust
this rote memorization. if im not mistaken, this will change
depending on day light savings time, whose rules have recently
changed themselves. hence, i do still think it's best to
just google for a UTC displaying web page.
anyway, i did that, obviously. but by then i was frustrated
enough to just try using linux to set the time instead of
the bios. i decided that the best way to do this was to
set the time in gnome, verify with the date command, and
then use hwclock --systohc to allow linux to do it's thing
with the least help from me. things went fine doing this,
but then i decided to reboot and see what happened. btw,
to be crystal clear, i did not change the /etc/conf.d/clock
to set the hwclock on reboot. to me, that was another matter,
that i would set, after resolving the actual time issue
im having. just setting that, after all doesn't fix a
broken clock. point being. i just used hwclock --systohc
manually.
so after rebooting, i figured 1 of 2 things would happen.
if it set the bios correctly, it would put in the correct
UTC so it would translate correctly upon boot up. if it
didn't work right, i figured it would have put the localtime
into the bios, and when i rebooted and it translated the
bios time as UTC, it would set the system time to be
5 hours too fast.
but instead, a 3rd thing happened. i got really frustrated,
in fact, actually _because_ my system time after rebooting
_is_ correct. in other words, hwclock --systohc put the
localtime into the bios, which i assume will mean the
next time i boot into windows the time will be correct,
but that's just an assumption at this point. because
linux somehow decided to display the correct localtime
even though my /etc/conf.d/clock says to use UTC in the
bios, and now i feel like an idiot. i really hate
feeling like an idiot.
any help would be appreciated.
|