There's a program called fake-hwclock
. You can install it using:
apt-get install fake-hwclock
It runs as service when the unit boots which restores the last known timestamp. This ensures the system time is not reset to the default beginning of UNIX EPOCH of 1970.
The above program combined with the ntpdate
package, should keep a RPi reasonably close to the actual time depending on network access and reboot cycles.
However, as pointed out in the comments, adding a RTC module will ensure accurate time keeping. So, it depends on your particular use case.
Use of ntpdate
If you do use ntpdate
, it's probably best to use the ntp pool servers, and set a cron job to run every hour or so to check the pool for the correct time.
#crontab -e
0 * * * * /usr/sbin/ntpdate pool.ntp.org