meta data for this page
  •  

This is an old revision of the document!


ntptime

Issues

ntp_gettime() returns code 5 (ERROR)

sudo ntptime

Reason: https://www.systutorials.com/docs/linux/man/2-adjtimex/

TIME_ERROR
  The system clock is not synchronized to a reliable server. This value is returned when any of the following holds true:
      *   Either STA_UNSYNC or STA_CLOCKERR is set. 
      *   STA_PPSSIGNAL is clear and either STA_PPSFREQ or STA_PPSTIME is set. 
      *   STA_PPSTIME and STA_PPSJITTER are both set. 
      *   STA_PPSFREQ is set and either STA_PPSWANDER or STA_PPSJITTER is set. 
  The symbolic name TIME_BAD is a synonym for TIME_ERROR, provided for backward compatibility. 

You can only set times in the future, setting past times with date command will do nothing and no error will be shown. Ntpd service will correct slowly the time at small steps. It's not like in Windows where you can set any time and see the result immediately.