LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-07-2006, 02:34 PM   #1
mbdyson
LQ Newbie
 
Registered: Sep 2005
Posts: 5

Rep: Reputation: 0
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.
 
Old 03-07-2006, 03:00 PM   #2
mbdyson
LQ Newbie
 
Registered: Sep 2005
Posts: 5

Original Poster
Rep: Reputation: 0
update to my own issue

well, i just tried rebooting again, in order to tryi inputting the
UTC that I now new directly into the bios and see what
happened to my system time in linux then....

another astonishing thing. it was correctly set to UTC.
i really can't explain this extremely odd behaviour.

to recap, i set the time so that date showed the correct
time for my timezone. then i used hwclock --systohc and
rebooted, where the setting to automatically sync back
to hw during reboot was off. it's still off. again,
after i resolve my actual confusion, i will introduce
myself to the automatic features later.

immediately after rebooting i went into the bios; it showed
that the hw clock was running correct local time, not UTC
as i had hoped. i continued into linux, expecting the local
time to be displayed as 5 hours behind because it subtracted
5 from what it thought was UTC but was actually local (excuse me if
i mistated my expectation due to poor addition and subtraction
skills in the previous post), and it wasn't. it was correct.

then i made the last post. then, i rebooted again, determined to
figure this out myself. in the bios again, i was amazed to find
it displayed the correct UTC time finally. and continuing into linux
i found it was still showing correct localtime.

the only thing i can conclude is that i'm an idiot. this
doesn't make any sense to me. can anyone explain?
at least now i feel better that my system is operating
correctly (since the bios time is showing UTC).

maybe later i will try to repeat what happened to verify
my sanity.

Last edited by mbdyson; 03-07-2006 at 03:13 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting system time to UTC triley Linux - General 2 08-25-2009 07:56 PM
System time setting listensea Mandriva 4 05-16-2004 12:30 AM
Setting System Time: kernel in wrong time zone warrenweiss Linux - General 7 05-15-2004 03:25 PM
Help -- Setting System time by C/C++ eg_wwkaa Programming 1 09-20-2003 01:43 AM
Setting the system time bughunter Linux - Newbie 2 04-20-2001 03:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration