Skip to content

Commit 99ae6c4

Browse files
authored
Update EspDateTime.ino
GMT and Force update
1 parent 30552d5 commit 99ae6c4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/EspDateTime/EspDateTime.ino

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@ void setup() {
1919
}
2020

2121
timeClient.begin();
22+
timeClient.setTimeOffset(10800); //GMT+3
2223
timeClient.update();
2324
}
2425

2526
void loop() {
2627
timeClient.update();
28+
29+
/*
30+
while(!timeClient.update()) {
31+
timeClient.forceUpdate();
32+
}
33+
*/
2734

2835
if (timeClient.isTimeSet()) {
2936
unsigned long epochTime = timeClient.getEpochTime();
@@ -53,4 +60,4 @@ void loop() {
5360
}
5461

5562
delay(1000);
56-
}
63+
}

0 commit comments

Comments
 (0)