Comment 7 for bug 1802233

Manoj Iyer (manjo) wrote :

So looks like it is slow to sync with RTC.

ubuntu@tiselius:~$ sudo /sbin/hwclock --set --date "2004/11/21 04:10:00"; sudo strace -e ioctl "/sbin/hwclock"
ioctl(4, RTC_UIE_ON) = -1 EINVAL (Invalid argument)
ioctl(4, RTC_RD_TIME, {tm_sec=0, tm_min=10, tm_hour=4, tm_mday=21, tm_mon=10, tm_year=104, ...}) = 0
ioctl(4, RTC_RD_TIME, {tm_sec=0, tm_min=10, tm_hour=4, tm_mday=21, tm_mon=10, tm_year=104, ...}) = 0

when the hwclock command fails, the ioctl that fails is RTC_RD_TIME.. but running it with --verbose probably gives it just enough time to complete the sync.

Or you could use the command as follows:
ubuntu@tiselius:~$ sudo /sbin/hwclock --set --date "2004/11/22 04:10:00"; sudo /sbin/hwclock --delay=0.5
2004-11-22 04:09:59.898618+00:00
ubuntu@tiselius:~$