When the raspberry turns on and it doesn't have an internet connection, the system time is wrong... On the context that I'm using the raspberry, it will not have any internet connection, but it will have access to the local network where it could get the correct current time from a different device on this local network. So, my doubt is: if I have the epoch timestamp of now, like 1608146451904, is it possible to make the system synchronize its time with this timestamp? Is there any command I can use or file I can edit that makes it possible?
If your Pi has no Internet access you can copy the date from the host by running
ssh [email protected] sudo date -s$(date -Ins) before connection.
date -Ins because it generates readable dates, but any form can be used
It should be possible to setup something similar, which runs on the Pi, but I have never done this.