diff --git a/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino b/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino index e8e8153647a..9300b6c23b7 100644 --- a/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino +++ b/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino @@ -44,8 +44,9 @@ void handleRoot() { digitalWrite(led, 1); char temp[400]; int sec = millis() / 1000; - int min = sec / 60; - int hr = min / 60; + int hr = sec / 3600; + int min = (sec / 60) % 60; + sec = sec % 60; snprintf(temp, 400, @@ -64,7 +65,7 @@ void handleRoot() { \ ", - hr, min % 60, sec % 60 + hr, min, sec ); server.send(200, "text/html", temp); digitalWrite(led, 0);