RTC time on a locally set clock
I have my hardware clock set to local time not to UTC time.
Imade an upgrade from 2.4.16 to 2.4.21 recentlly and I saw that the time is displayed as if I had the time stored to UTC. The time was correctlly displayed with the older kernel. How could I counfigure it to show the local time? I mean, what should change? |
My guess is the new kernel was compiled with
CONFIG_APM_RTC_IS_GMT set. In make menuconfig you can change this under General Setup -> Power Managment -> Advanced Power Management BIOS support -> RTC stores time in GMT. |
standard behaviour
The kernel I have installed is a standard kernel that came through apt-get ;), so my question is: Is this the standard way to compile the kernel?
Anyway, at the installation of the system I was asked if my time was GMT or if it was local. Is this a matter of the 2.2.20 kernel? (yes, 2.2.20-woody). |
I don't have any experience with Debian, so this is based on my
experience with Slackware. In it's setup process it also asks if the RTC is local or GMT/UTC, which it stores in /etc/hardwareclock. Then the startup scripts poll this file, and set the system time based on it: using either "hwclock --utc --hctosys" or else "hwclock --localtime --hctosys". So now that I've looked into it further, I'm actually not sure what the kernel option does. Wild guess is it sets the default for if "hwclock --hctosys" (set system time from the RTC) is called without specifying --utc or --localtime. So my suggestion to resolve this would be to look through your startup scripts & find where the system time is set, and make sure it is using --localtime. Here are the /etc/hardwareclock file and the relevant part of my startup scripts. Code:
# /etc/hardwareclock Code:
# Set the system time from the hardware clock using hwclock --hctosys. |
I don't have any /etc/hwdclock or something alike, but I found two scripts in /etc/init.d that are ran at boot time (rc.S) and they depend on a variable UTC that should be yes or no. Is not specified in the hwdclock.sh scripts but as I found out from the man pages there should be in rc.S
I've set the UTC var in rc.S script, but for the moment I haven't restarted the box. I hope this will do the trick. I will tell you how it worked when I get back from work. |
/etc/default/rcS
that's where the UTC variable is set |
/etc/default/rcS
that's where the UTC variable is set |
problem unknown
I found that in rcS the UTC variable was set to no but I must have had at one time an application that changed the hour in BIOS directly and not through the kernel clock.
So the BIOS time was set incorectlly. Changed in BIOS then no more problems... :scratch: the question remains: who was the offender :) ? |
forgot to thank people ...
Thanks to everybody for the posts...
|
All times are GMT -5. The time now is 03:16 AM. |