Update EspDateTime.ino
GMT and Force update
This commit is contained in:
parent
30552d5379
commit
99ae6c4ba0
@ -19,11 +19,18 @@ void setup() {
|
||||
}
|
||||
|
||||
timeClient.begin();
|
||||
timeClient.setTimeOffset(10800); //GMT+3
|
||||
timeClient.update();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
timeClient.update();
|
||||
|
||||
/*
|
||||
while(!timeClient.update()) {
|
||||
timeClient.forceUpdate();
|
||||
}
|
||||
*/
|
||||
|
||||
if (timeClient.isTimeSet()) {
|
||||
unsigned long epochTime = timeClient.getEpochTime();
|
||||
@ -53,4 +60,4 @@ void loop() {
|
||||
}
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user