Sample Header Ad - 728x90

How to set time in nanoseconds?

2 votes
1 answer
2946 views
I have a Raspberry Pi with a GPS module connected to it. Since all GPS satellites have very precise atomic clocks on them, I would like to synchronize the Pi's clock to the satellites' clocks. I know how to get the date and time from the satellites, and set my Pi's time with: sudo date -s "MAR 14 2016 14:53:09" But that is only accurate to the seconds, I would like to at least get milliseconds, but I would prefer nanoseconds. I know that date +%s%N returns time in nanoseconds. How do I set the time in nanoseconds?
Asked by Patrick Cook (251 rep)
Mar 14, 2016, 08:08 PM
Last activity: Mar 1, 2018, 12:01 PM