Should programs handle system time jumps?

From: Ulrich Eckhardt (doomster_at_knuut.de)
Date: 08/30/04


Date: Mon, 30 Aug 2004 12:45:58 +0200

Hi!
I'm in an argument with a coworker about whether a program must gracefully
handle jumps in the system time. The jumps occur when, for demonstrating
logfile cleanup, people set the time a year ahead or back. This
test-procedure is part of a validation, so not really easy to change.

The problem is that certain threads that poll things wait between polls for
e.g. a second. If, in that waitcycle, the systemtime is rewound by a year,
it will wait virtually forever.

My point of view is that this is not a normal working condition and it is
perfectly valid to require a reboot for the clock change. Related to that,
can anyone give examples for programs that are either designed to handle
this gracefully or known no fail under such circumstances? Im particularly
interested in typical services running on MS Windows >= NT 5.0 and Debian
GNU/Linux, both configured to be rather 'embeddish'.

I know that NTP clients are written so that they don't create jumps in
systemtime. They rather accelerate or slow down the systemtime until it
reaches the target setting.

thank your for any pointer

Uli



Relevant Pages

  • Re: Should programs handle system time jumps?
    ... The jumps occur when, for demonstrating ... If, in that waitcycle, the systemtime is rewound by a year, ... So far I have never seen a service failing with a time change, ... typedef void (WINAPI *TimeChangeNotification); ...
    (comp.programming)
  • Re: Set the local time
    ... >> How can I set the system time using a DateTime object??? ... > with the SetSystemTime method in kernel32.dll via PInvoke. ... > method accepts a SystemTime structure as its parameter. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Set the local time
    ... > How can I set the system time using a DateTime object??? ... You can't set the local time with the DateTime structure, ... with the SetSystemTime method in kernel32.dll via PInvoke. ... method accepts a SystemTime structure as its parameter. ...
    (microsoft.public.dotnet.languages.csharp)
  • newbie could somone please tell me why this code does not work
    ... Hi i have alterd some code that changed the system time so it changes ... the date could you olease tell me why it does not work ... SystemTime systemTime); ...
    (microsoft.public.dotnet.languages.csharp)