PINE64
How to update the RTC date (time set to last timestamp before shutdown) - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111)
+--- Forum: Pinebook Pro Tutorials (https://forum.pine64.org/forumdisplay.php?fid=117)
+--- Thread: How to update the RTC date (time set to last timestamp before shutdown) (/showthread.php?tid=10173)



How to update the RTC date (time set to last timestamp before shutdown) - JasonG-FR - 06-10-2020

After using my PineBook Pro for a few days, I noticed that the time was wrong (set to the exact date and time of the shutdown) when it was booted without being connected to the internet.

I don't know if it's a rare issue or not, but since I couldn't find any fix for this I figured I'd make a small tutorial in case someone else have the same issue in the future.

After searching for a bit, I found that the PineBook Pro have a Real Time Clock (RTC) so it should be able to keep track of time while being powered off.

My RTC date and time wasn't apparently set correctly (it was set to an arbitrary date in 2007) which confused the system that decided to use the last known timestamp instead. Thankfully, the fix is easy:

1. Check if the RTC date and time match the actual date and time by running:
Code:
sudo hwclock -r

2. If the value isn't correct, make sure that the system date and time is correct by running the `date` command:
Code:
date

3. If the system date and time isn't correct, either change it manually or connect to the internet so the clock adjusts automatically.
4. To set the RTC date and time to the system date and time, run the command:
Code:
sudo hwclock -w

5. Check that the RTC date is now correct by running the `sudo hwclock -r` command again.
6. Your PineBook Pro will now have the correct date and time, even offline.


RE: How to update the RTC date (time set to last timestamp before shutdown) - jiyong - 06-10-2020

I have also had this issue.
The RTC started working again after I booted Debian from a SD card.
Not sure why it started working after that.
Perhaps some other distro will work too.