-
-
Notifications
You must be signed in to change notification settings - Fork 127
FAQ #3
Michael Miller edited this page Dec 27, 2016
·
2 revisions
The time from a NTP Server is the seconds since Jan 1st, 1900.
Epoch time is seconds since Jan 1st, 1970.
First convert your NTP time to Epoch time.
This Sketch demonstrates getting the NTP time from a server and converting it to Epoch time.
With an Epoch time initialize RtcDateTime with it and set it on the RTC object.
RtcDateTime timeToSet;
timeToSet.InitWithEpoch32Time(myEpochTimeValue);
rtcObject.SetDateTime(timeToSet);