Home › Forums › Forums › General discussion › RTC on Berry GPS-IMU › Reply To: RTC on Berry GPS-IMU
November 18, 2018 at 12:47 am #7633
bepeho
Participant
Hi Jon,
I had to programmatically synchronize the rpi clock.
A periodic task gets the gps time and call a the system date command
In Java, that’s:
Date date1 = new SimpleDateFormat("ddMMyyHHmmss")
.parse(gpsDate.stringValue() + gpsTime.stringValue());
cmd[0] = "/bin/date";
cmd[1] = String.format("-s %s", date1);
ProcessBuilder processBuilder = new ProcessBuilder(cmd);
I hope it helps.
Patrice