views:

16

answers:

1

if the system time changes for day light saving time, does the output of gettimeofday() is changed?

A: 

Note that Unix systems do not "change the system time" with daylight saving time -- it is all handled when programs want to print the current time, typically using localtime(3).

The seconds since the epoch keep counting monotonically even when local governments decide to change the clocks on our walls.

sarnold
thanks. does that mean if i change the system time while a program is running, the program invoking gettimeofday() periodically to do some bookkeeping/logic processing etc, will not be affected?
weima
It should be fine ;) but I have to admit I've never thought to check around timeswitch time. Hehe.
sarnold