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
2010-08-04 10:18:19
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
2010-08-04 10:28:18
It should be fine ;) but I have to admit I've never thought to check around timeswitch time. Hehe.
sarnold
2010-08-04 10:44:14