LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Time goes back 4 hours on every boot (http://www.linuxquestions.org/questions/slackware-14/time-goes-back-4-hours-on-every-boot-309719/)

lagartoflojo 04-04-2005 04:59 PM

Time goes back 4 hours on every boot
 
Well, hello!

I have a problem: everytime I boot my PC, the time is set back 4 hours relative to the time that was set on the last boot. ie, if the clock says 14:00 now, and I reboot, the clock will say 10:00. This all started when I followed the instructions here to set my clock to the right time (it was 10 minutes slow before, but at least none of this magic time-changing happened). So what I want to know is how to fix this so the clock will be normal again.
Here's some output that might be useful...
Code:

hernan@hernan:~ (23.740 MB)$ date
Sat Apr  2 01:55:59 CLT 2005
hernan@hernan:~ (23.740 MB)$ /sbin/hwclock
Sat 02 Apr 2005 05:56:11 AM CLT  -0.178997 seconds

(as you can see, the kernel clock and the hw clock differ).
It probably has something to do with my timezone (CLT: -4 hrs) but I have no idea on how to go about fixing this.
The basic instructions I followed to set the clock were:
Quote:

Summary

* /etc/sysconfig/clock sets whether the hardware clock is stored as UTC or local time.

* Symlink /etc/localtime to /usr/share/zoneinfo/... to set your timezone.

* Run ``date MMDDhhmm'' to set the current system date/time.

* Type ``/sbin/hwclock --systohc [--utc]'' to set the hardware clock.
Thanks for your help,
-- L*F

keefaz 04-04-2005 05:18 PM

I have too a delay between hardware clock and system time
Code:

$ date
Tue Apr  5 00:12:00 CEST 2005
$ /sbin/hwclock
Tue Apr  5 00:12:30 2005  -0.809428 seconds

Slackware provides a tool to set zone time, as root try:
Code:

# timeconfig
And you could set your machine time with a time server
Code:

# ntpdate cl.pool.ntp.org
I used here a time server in Chili, look at this list :
http://ntp.isc.org/bin/view/Servers/NTPPoolServers

lagartoflojo 04-04-2005 05:37 PM

Thanks! I hope the changes live a reboot =D

-- L*F

dhave 04-04-2005 05:38 PM

Re: Time goes back 4 hours on every boot
 
Quote:

Originally posted by lagartoflojo
I have a problem: everytime I boot my PC, the time is set back 4 hours relative to the time that was set on the last boot. ie, if the clock says 14:00 now, and I reboot, the clock will say 10:00.
If this were a Windows box, I'd suggest just rebooting six times. ;-]

(Sorry. I couldn't resist.)

keefaz 04-04-2005 05:43 PM

You could put ' ntpdate cl.pool.ntp.org ' in /etc/rc.d/rc.local ;)
To be more accurate, better is to put it in a crontab, though

lagartoflojo 04-04-2005 06:04 PM

Re: Re: Time goes back 4 hours on every boot
 
Quote:

Originally posted by clawhead
If this were a Windows box, I'd suggest just rebooting six times. ;-]

(Sorry. I couldn't resist.)

haha... mmk.

--L*F

lagartoflojo 04-04-2005 06:04 PM

Quote:

Originally posted by keefaz
You could put ' ntpdate cl.pool.ntp.org ' in /etc/rc.d/rc.local ;)
To be more accurate, better is to put it in a crontab, though

I'll have to read up on this crontab stuff.. thanks =D

-- L*F

slackwarefan 04-04-2005 07:50 PM

I had this problem before. It was because I had set my clock to utc but told it local, or the other way around. There's a shutdown script you can modify. I'll try to find it. or you can grep for hwclock in your shutdown scripts.

lagartoflojo 04-06-2005 08:28 AM

using "timeconfig" and getting the right time from an ntp server, then doing "/sbin/hwclock --systohc" solved the problem. thanks =D

-- L*F


All times are GMT -5. The time now is 06:30 AM.