FYI, as the Raspi doesnt have an RTC, below one saves/restores the clock to/from a file on boot/shutdown:
pi@ph5b:~ $ systemctl list-units '*fake*'
UNIT LOAD ACTIVE SUB DESCRIPTION
fake-hwclock.service loaded active exited Restore / save the current clock
pi@ph5b:~ $ systemctl cat fake-hwclock.service
# /lib/systemd/system/fake-hwclock.service
[Unit]
Description=Restore / save the current clock
Documentation=man:fake-hwclock(8)
DefaultDependencies=no
Before=sysinit.target shutdown.target
Conflicts=shutdown.target
[Service]
EnvironmentFile=-/etc/default/fake-hwclock
ExecStart=/sbin/fake-hwclock load $FORCE
ExecStop=/sbin/fake-hwclock save
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target
Below one updates that file every hour:
pi@ph5b:~ $ cat /etc/cron.hourly/fake-hwclock
#!/bin/sh
#
# Simple cron script - save the current clock periodically in case of
# a power failure or other crash
if (command -v fake-hwclock >/dev/null 2>&1) ; then
fake-hwclock save
fi
pi@ph5b:~ $ man fake-hwclock
[..]
FILES
/etc/fake-hwclock.data
The file used to store the time