When my notebook has no battery and is disconnected from the power cord, it can lose track of the time. To set the time of the hardware clock, you may run, as root:
hwclock --set --date="2017-07-21 22:37:00"
Then, the system time is set with:
hwclock -s