Will NTP drift the clock backwards

Will NTP move the system clock backwards? I'm thinking about creating unique ids which are partially based on the time. If the clock is moving backwards, I'd need to somehow account for that.


ntpd will try to prevent time from moving backwards by slowing down the system clock until everything is in sync. If the system clock is too far ahead, however, ntpd will complain and you'll either need to adjust manually or pass the -g flag to ntpd to allow it to make one (and only one) big adjustment.


Two things could happen. The clock could be adjusted back, or the ntpd server will keep adjusting the RTC clock until the two clocks are in sync. Effectively, this looks like the local clock time has slowed down while waiting for the server to catch us up. This process is called slew correction.

Which option is chosen by the ntp client depends on configuration. Consult the man page in your system to ensure that the slew option is chosen so that the time doesn't drift backwards. Note that the time can be allowed to drift backwards if it is significantly out. So watch for that. Also, be aware of daylight savings. That could be a hole in your design anyway.

See NTP docs... http://doc.ntp.org/archives/4.1.0/ntpd and the section named "how ntp operates". for further information.