From 99ae6c4ba0cc80a754b3aa95853ac49a181b16e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hamza=20Ye=C5=9Filmen?= <78810304+HamzaYslmn@users.noreply.github.com> Date: Wed, 17 May 2023 15:45:33 +0300 Subject: [PATCH] Update EspDateTime.ino GMT and Force update --- examples/EspDateTime/EspDateTime.ino | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/EspDateTime/EspDateTime.ino b/examples/EspDateTime/EspDateTime.ino index 8531649..948dcdf 100644 --- a/examples/EspDateTime/EspDateTime.ino +++ b/examples/EspDateTime/EspDateTime.ino @@ -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); -} \ No newline at end of file +}