Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Hardware

Weird PC Clock Behavior? 70

cybercyst asks: "I've been having a problem with this for quite some time, and thought it was just me -- until two good friends of mine experienced the same problem. What we are experiencing is best described as a time-skew: our system time is apparently jumping forward an hour, and then returning to normal. It repeats this multiple times, and as far as I can tell only a reboot is any sort of remedy for this, albeit a temporary one. As you can imagine this causes all sorts of problems (under windows managers xscreensaver is always popping up -- in fact as I wrote this, the screensaver has come on over 10 times, negative fps in OpenGL programs, extremely large ping times, and so forth)."

"Friend A runs an Athlon system on a Soyo Dragon motherboard, I'm running a K6-2 450Mhz CPU on an older Epox motherboard. We are both running Slackware 8.0 with kernel 2.4.17, but Friend B runs nothing but Red Hat, and kernel 2.4.2-2.

I have personally tried many things to get this fixed permanently, including setting the time with 'date -s; hwclock --hctosys; hwclock --systohc' the BIOS is set to the right time that doesn't seems to help! So, I'm asking Slashdot, Has anyone out there encountered a similar problem, and if they have, have you been able to fix it?"

This discussion has been archived. No new comments can be posted.

Weird PC Clock Behavior?

Comments Filter:
  • by mclinc ( 87199 ) on Wednesday February 06, 2002 @04:47AM (#2960550) Homepage
    Have you checked for nearby chronoton emisions?

    Try a tatacion burst, that normaly helps...
  • Try Truetime (Score:4, Informative)

    by Perdo ( 151843 ) on Wednesday February 06, 2002 @04:52AM (#2960556) Homepage Journal
    Nothing beats your very own nuclear clock on a PCI card. [truetime.com] The best they can make you is a rubidium standard clock accurate to 10^-13 seconds. Cesium beam clocks accurate to 10^-17 seconds are available in rackmount form. Great for all those Mission Critical Real Time applications like Quake III.
    • by Anonymous Coward
      If you're going to spend $1250 [realtime-info.be] to fix a linux bug, why not spend significantly less and fix them all at the same time [microsoft.com]
      • by Anonymous Coward
        Windows comment may be flamebait, but the boards do really cost $1250!
      • actually, one should be careful to which version of windows is used. It's been my experience that Win98 loses time as the days go on without reboots. They lose about 30 seconds after one day, a 1-2 mins after 2 days, 7-10 after 3 days, ya get the idea -- not to mention the system slows down as the days go on too. Typically restarting puts everything back to normal, as Windows uses the system clock to set it's own clock during boot, and relies solely on it's own clock from then on.

        Win2K (and I assume WinXP) dont have these time loss and slowdown features.
        • Re:Try Truetime (Score:3, Interesting)

          by Kingfox ( 149377 )
          Yeah, Win95 and Win98 lose time often. There's a great feature in the Novell network client that lets you fix the clocks that can help get around that problem. It automatically sets the clock to what the servers are set to, and as long as you keep them properly set, you don't have to worry about some old Win98 machine in the basement losing time and causing someone to miss a meeting.
          • The only problem here is that the Novell client only sets the clock at login time. If you leave the computer running for a while, the clock will still drift.
            • Re:Try Truetime (Score:3, Insightful)

              by Kingfox ( 149377 )
              True. At least it keeps all of the lab computers (many logins during a day) on time, and people who login daily can't drift THAT much.
              • For the most part, you're right. My lab is a different story becuase the NetWare server's clock gains anywhere from 15 minutes to several decades per day. At least it did until I setup timesync to point to time.nist.gov:123. :-)
    • I don't see anything about an atomic clock there. Both of them are cards for synchronization to external sources. (GPS, or an external atomic clock)
      • Sorry, I was hopeing for +1 funny not +1 interesting. Rubidium standards cost $4,500 and Cesium beams cost $15k+. Truetime's cards all have accurate local oscilators but refrence external clocks. But it was purely a joke. Buying a weapons grade timing source as a bug fix is funny. Laugh.

        As true time was primarily a government contractor, At least a few people in the army thought that was a completely acceptable bug fix.
  • A blind guess: It might be that there are some errors in the code, and the OS tries to adjust clock for daylight saving changes.
  • by jakobgrimstveit ( 556576 ) <jakob.grimstveit@gmail.com> on Wednesday February 06, 2002 @05:53AM (#2960647) Homepage
    You might have to delete /etc/adjtime after adjusting your clock. This file is updated now and then to prevent clock drift.

    'man 8 hwclock' and 'The Adjust Function' might give you some answers.

    Give it a shot, at least.
  • by Lord Sauron ( 551055 ) on Wednesday February 06, 2002 @06:53AM (#2960722)
    It's not a virus? I received an e-mail that advised about a terrible virus that no antivirus company could defeat, and both IBM and Microsoft were very concerned with it, althought, of course, they also could nothing to stop this beast.

    Have you by chance opened an e-mail with subject "Good Times"? You should have deleted it upon receipt. Now you're infected. And, because of the name "Good Times", it sure can change your computer time.

    That was an easy one. Next !
  • My opinion (serious) (Score:5, Interesting)

    by Lord Sauron ( 551055 ) on Wednesday February 06, 2002 @07:09AM (#2960747)
    [from http://www.debian.org/doc/manuals/system-administr ator/ch-sysadmin-time.html]:

    Computers have a clock to keep time. Usually there is a hardware clock with battery backup to keep time when the computer is off. The operating system (for example Linux) runs its own clock, and from this clock comes the time shown by commands such as date in Linux and time in DOS.

    The hardware clock is usually accurate enough, provided that the battery has not run out. If the time shown by the computer when you turn it on is wrong by several months or years, it is worth checking if the battery is still usable.

    The "software" clock in the operating system usually has drift, either systematic or random. This drift means the clock runs too fast or too slow. For this reason it is necessary to use some accurate time source to syncronize the operating system clock if accurate time is needed.

    [my opinion:] Normally I'd just say: Use NTP [udel.edu]. But your random time drift seems to be so high, NTP would freak out.

    It seems to be a hardware problem, or some friend made a practical joke on you, inserting some random time drift in crontab. Try to reinstall your OS and check if this behavior continues. If so, you should change your motherboard. And try to get a good one, like Asus.
  • by cybrpnk ( 94636 ) on Wednesday February 06, 2002 @07:26AM (#2960780)
    I know where you are coming from! This time shift has been a major headache for me at work [warningsystems.com]. My group installs computer systems at emergency management agencies (EMAs) that selectively trigger radios by a precoded geographical zone or serial number. We have a security feature in our broadcast that is basically a time stamp - the radio rejects a broadcast if the timestamp is more than 5 minutes off its internal clock. This prevents somebody from taping a monthly test message and rebroadcasting it at three in the morning to falsely trigger the radios. Well, at the EMAs they just want to sit down at the PC during an emergency and click on a button - so the PC is ignored until it's really needed and then they don't want to waste time checking to see if the clock has jumped. If it has, oops, the broadcast timestamp doesn't match and the radios don't trigger!!!

    We have never figured out how to stop the computer time from jumping and if anyone else has, please let me know! The workaround solution we've come up with is to either install a network time update program running in the background if the computer is on the web (for examples, search for "time sync" here [zdnet.com]or for the more common rural EMAs that have no Internet connection, we install clock boards. We have found three sources for clock boards: Beagle Software [beaglesoft.com], OutSource [outsrc-em.com] and ICS Advent [icsadvent.com]. The Beagle product is ISA only, the OutSource product only works with Win 2000/NT (not Win 95/98) and the ICS product is far and away the most expensive. If anybody knows of others besides these three, please let me know!
    • by Andy Dodd ( 701 )
      I'm not completely sure (as my Garmin is at home), but I believe the NMEA protocol includes timestamping. I'd be shocked if it doesn't.

      It's not the microsecond accuracy that specially-designed GPS systems have, but it'll definately be accurate to within a few seconds.

      Even a simple $99 Garmin eTrex could probably solve your problems, although you might want to go with a more expensive unit with an external antenna (maybe the eMap). Or you could buy one of the dedicated serial GPS modules, like the Garmin 35.
      • We looked at GPS and yeah, they're cheap, and yeah, they're accurate, and nope, they won't pick up a satellite signal inside the basement where all the emergency EMA computers are, and it's easier to just put in a clock card than it is to put the GPS where it can pick up the signal and then run a serial port line from the GPS to the computer.

        Now, if Garmin came out with a cheap GPS that plugged directly into ethernet instead of a serial port, then we'd have something....
  • use ntpd (Score:4, Insightful)

    by Andrew Lockhart ( 4470 ) on Wednesday February 06, 2002 @07:34AM (#2960791) Homepage
    once a linux system (i'm presuming you're using linux because you mentioned hwclock) has booted it doesn't use the hardware clock to keep time any longer and instead relies on the kernels own internal timing structures. in short use ntpd, it will query a time server periodically and correct your clock drift.

    for more info on how linux keeps time checkout the hwclock and adjtimex man pages.
    • (i'm presuming you're using linux because you mentioned hwclock)

      That's a pretty good assumption. Though, your powers of preception could have been put to rest on this one since he specficially said all three systems having this problem were running various flavors of Linux distros and kernels.
  • by Anonymous Coward
    You don't say which timezone you are in, but I guess all 3 of you are in the same one. Perhaps you're the only 3 linux users in your zone, and the zoneinfo data is wrong!

    (Zoneinfo can specify pretty much arbitrary time corrections - I used to have my own timezone with daylight savings just for an hour every day, so I could fool the timeclock software about what time I got back from lunch. Amazing what unix programs will believe, even when you're not root...)

    The compiled zoneinfo files are binary, so a few corrupt bits could easily do this.

    Try running 'TZ=GMT date' on a regular basis, and see if the underlying system time is jumping about, or only your 'local' time....

    (As another poster said, the hwclock is only used at bootup time, to set the inital clock)
  • Competing Time syncs (Score:4, Informative)

    by Outland Traveller ( 12138 ) on Wednesday February 06, 2002 @09:27AM (#2960996)
    You want to be sure that you only have one time synchronization daemon running. It sounds like you might have more than one, with one misconfigured to ignore daylight savings time or something similar.

    ntp is the most robust free time synchronization software. Try using that in preference to rdate, timed, timeslave, etc. Test ntpd by using "ntpdate" against your upstream ntpd time servers to make sure they do what you expect.
  • Every time I've mentioned this, I've been told that I'm either trolling, or my clock needs a new battery. But if's FUCKING ANNOYING when your backup script, which includes shutting down the database, is croned to run at 4 AM, runs at pretty much random times.
  • New Battery (Score:2, Redundant)

    by Levine ( 22596 )
    My machines have done very similar things in the past. You need a new BIOS battery, that's all. Radio Shack carries them for around $4.

    Cheers,
    levine
    • No, it is not a BIOS battery issue. The battery only tracks the time when the system is powered down (and now with ATX power supplies when the poewr cord is disconnected.) Once any OS boots, it keeps track of time on its own via the RTC and counters. This is a software related issue. Its a known issue and usually its not this bad.
  • Linux Timing Problem (Score:2, Interesting)

    by Anonymous Coward
    I don't care what anyone says, there *IS* a major problem with the Linux clock. I too have had the same problem with another distro. I wasted countless days trying to solve it, without success. My machine is dual booted with Windows (NO windows was not causing the problem!) and while the Linux boot had horrendously erratic time, Windows had no issues.

    A month ago, I wiped the system and re-installed Linux. The problem went away but, now I have a different time problem. Now, my Linux clock runs slooowww when the systems is under any sort of a load. If the systems is left idle the clock keeps perfect time. Run Konqueror for a while and the clock goes to shit. Run an editor, doesn't seem to matter which, and the clock is worthless. Hell, let a screen saver run overnight and the clock loses 5 hours.

    There is a problem with the clock!
  • Are you sure you're not using Windows? ;)
  • UTC=false? (Score:3, Informative)

    by cowbutt ( 21077 ) on Wednesday February 06, 2002 @10:51AM (#2961297) Journal
    I notice that you're dual-booting with Windows. Check that your /etc/sysconfig/clock file contains the line:

    UTC=false

    Because Windows diddles with the hardware clock directly, it can't be used (directly) as a UTC time source for UNIX.

    Naturally, if you're ONLY running Linux, you can have UTC=true and forget about it.

    --

    • I notice that you're dual-booting with Windows.

      I don't see where he said that.

      Because Windows diddles with the hardware clock directly, it can't be used (directly) as a UTC time source for UNIX.

      It can if you tell Winblows that your local time zone is UTC, and then correct it in your head when you look at the clock. Or is that just too damn geeky?

      • s/too damn geeky/too damn much processing power/;

        although, what you could do is have windows update time on boot (xp has built-in support for periodic time updating, other versions can do it too, but not quite as easily), and have linux update time on boot, and not care what time it is when you start running :)

        i know the cable modem i have at home has no sense of time when it starts, it picks up the time from the cable signal (would be a nice feature of the service to allow my pc's to pick up that signal too, but *sigh*)
  • by NOT-2-QUICK ( 114909 ) on Wednesday February 06, 2002 @11:05AM (#2961348) Homepage
    As many have already pointed out, once the OS successfully boots the responsibility of maintaining the current time transfers to the operating system. As a result of this transition, 'time drift' is completely possible - even common - on systems that maintain long up-times (e.g. *nix).

    As the original question states, this offset in time is automatically corrected upon reboot. This is due to the OS once again keying off from the far more reliable internal hardware clock.

    To me, the cause/solution to this individual's issue is quite apparent. The issue is caused by running far too stable of an operating system - LINUX. As such, the somewhat obvious solution to change the installed OS to something a bit, shall we say, less reliable.

    Like many, when I think of unreliability I immediately think of Windows!!! May I suggest the ME version - in my very limited experience with this product, I have found it to be most unstable...your consequently, workstation will never go without a reboot for a long enough period to ever experience time drift again!!!
  • I use Debian unstable and I have the same problem. I have an Athlon 650 and an Abit motherboard running 2.4.17. It's not the battery. It's not my time zone. It's not UTC true/false. Just every once in a while my clock jumps around one hour and eleven minutes into the future. Sometimes it pops right back, and sometimes it sticks there until I tell it to stop. NTP might provide a way to deal with this issue, but it doesn't solve the real problem. I'm guessing that it has to do with the kernel and the AMD processor.

    Until today, I thought it was just me.

    • Its doubtful that having an AMD processor is related. If it is, its indirectly. For example, that might be the issue because everyone building AMD chipsets use the same RTC circuit. Therefore, this is a problem. I have Intel processors in my computer and the clock plays funny tricks from time to time.
  • Try changing your time zone so it doesn't use daylight savings time. That will at least tell you if it's DST-related or not.

    (I don't know how offhand - anyone?)
  • I'm using Windows XP with a new computer (1.4 ghz dell) and my clock loses substantial time. Right now, I have an uptime of about 2 weeks but my clock is 5 hours off. I keep fixing it but it keeps losing more and more time.

    Any help would be appreciated. This is particularly annoying because I use time-sensitive applications.
    • assuming your pc has a fairly often internet connection, turn on the time correction service in xp (its available from the time/date properties) and then go searching in the registry to change the time to something more frequent than once a week

      (my laptop loses a lot of time, so i have xp synch the clock every 2 hours)
  • I was interested to see this discussion pop up because I am having a similar problem with Windows. Its as can probably be expected when using something so crappy, but my PC at work (Compaq Deskpro), running Win 98 (not by my choice) is having odd clock related problems. My clock gets slower and slower throughout the day. Its not the battery, as it goes back to the correct time if I reboot. My emails are sent out with the correct time/date stamp, not what shows up on my system clock. Its not the power in my office (that has been checked and there are no fluctuations). And, to top it off, I was given a newly reimaged computer of the same type and its now started doing the same thing. Think it could be software? Something in the bios I should check? Anybody have any insight for me??? Switching computers or my OS is not an option.
  • Almost every older HP i have worked on (3-4 years ago) has had time problems similar to this. I am not sure what the link is if any.
  • Power management? (Score:4, Informative)

    by dead_penguin ( 31325 ) on Wednesday February 06, 2002 @04:13PM (#2963146)
    This is just a guess, but could your problems be related to apm or some other power management features? A bit over a year ago I was playing with apm on my Linux desktop. Whenever the computer went into a suspend or low-power mode, my clock would be completely messed up by several hours. I'm not sure if it was a bug on my motherboard, a bug in the apm code, or just that I'd misconfigured something. Either way, I just disabled all power management features (except using xset to turn off the monitor with dpms) and haven't had a problem since.

    If you try this, you'll probably want to turn power management off both in software (remove apmd etc.) and in the motherboard's bios settings. Most motherboards should allow you to do this.

    Good luck!
  • I've seen similar problems in our office with a few of our K6-II desktop machines running FreeBSD; I can't recall the motherboard, but I seem to remember them all being VIA chipsets.

    We submitted a problem report to the BSD guys and after a little bit, they confirmed that it was an APM problem. We recompiled the kernels without APM support and it disappeared.

  • External EMF? (Score:3, Informative)

    by Whatchamacallit ( 21721 ) on Thursday February 07, 2002 @12:11AM (#2965559) Homepage
    The only time I've ever witnessed something like this was when I serviced a client who kept complaining about time jumps (usually backwards and in large hour chunks). I'd swapped all the hardware several times (motherboard, battery, processor, memory, all the ISA cards, etc).

    Finally, I saw it happen. It was right about lunch time and on the other side of the wall was the worlds oldest radar range (pre Microwave Oven). That sucka kicked in when someone heated their lunch and the clock on the computer actually ran backwards!

    I had to move the desk away from the wall several feet and the problem stopped happening.

    More than likely though, the problem is with a buggy BIOS or dying battery. Replace the battery, flash your BIOS to the latest revision. If this doesn't work then you're only out about $10.00. Next step is to either buy an add-on time device that works properly or if you have a net connection running all the time, look into the NTP (Network Time Protocols) to sync with the Naval Observatory or another good source for correct time on as frequently a basis as you require.

    Also check out the Linux clock features like the realtime daemon, it's not for realtime as in realtime OS but for more accurate time keeping. Red Hat has this daemon by default.

    Check your security, make sure a co-worker is not just trying to mess with your head by changing your clock remotely.
  • replace the battery on the mobo... it's dying.

    -CH

Neutrinos have bad breadth.

Working...