in reply to Getting date and time from other computer

All PC clocks will gradually go "out of sync", just like your wristwatch does but at an accelerated rate because the crystals in PC are cheap. I agree with JavaFan, talk to your sys admin about this. It may be almost a "non-issue".

I am compelled to ask: Why do you even need this? I can think of some good reasons, I want to hear yours.

Sync'ing clocks in a network can be complex. Let's say my PC's clock is "too slow" vs "actual time". Ok, I can set my clock forward say 3 seconds and things will probably be fine.

Now what happens if my PC clock is "too fast" vs "actual time"? If I set my clock back 3 seconds, I will probably cause "time sequence errors" in log files, etc.

The way "I'm too fast" is handled, is by slowing my clock down until "actual time" catches up with me (ie maybe it takes me 61 actual clock seconds to tick off 60 of my clock seconds). That way all my files and log messages have the same time sequential order.

Anyway if this really is a network, your time will be the same as the others on the network. I remain curious as to your application.

  • Comment on Re: Getting date and time from other computer

Replies are listed 'Best First'.
Re^2: Getting date and time from other computer
by ruzam (Curate) on Sep 08, 2009 at 13:52 UTC

    I don't know what the OP has in mind, but we recently started working with some embedded system devices. Our device of choice has no clock battery at all, so every time you power up the clock must be reset. These devices are intended to be used remotely over the internet, so first thing it does is start openvpn to create a secure network to it. But without a reasonably close clock, openvpn won't even validate. So we use rdate just after the network starts to grab time off one of our servers.

    Mind you we don't run Perl on our device, but I image there are plenty of real world situations where you just don't have a proper time to start with.

      I think this is a fine example of an application that would need to get the approximate time to "get going". I don't know what the OP has in mind either. I do know that you have a very clear idea of what you are doing and why you are doing it. I remain curious as to the OP's application.