Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Revision:
23:f340b48d0538
Parent:
22:f45bbb468439
Child:
24:0ed9f1faea96
diff -r f45bbb468439 -r f340b48d0538 http-clock-script.inc
--- a/http-clock-script.inc	Wed Jan 09 18:22:56 2019 +0000
+++ b/http-clock-script.inc	Wed Jan 09 18:44:28 2019 +0000
@@ -100,10 +100,10 @@
 "    if (!leapEnable) return; // Adjustment disabled\n"
 "    \n"
 "    //Get the calander date and time from the ms\n"
-"    var now       = new Date(msCount - msCountAtRtcSet + msRtc);\n"
-"    var leapStart = new Date(leapyear, leapmonth - 1, 1, 0, 0, leapBackward ? -1: 0);\n"
+"    var now       = msCount - msCountAtRtcSet + msRtc;\n"
+"    var leapStart = Date.UTC(leapyear, leapmonth - 1, 1, 0, 0, leapBackward ? -1: 0);\n"
 "    \n"
-"    if (now.getTime() < leapStart.getTime()) return; //Do nothing until reached the leap start\n"
+"    if (now < leapStart) return; //Do nothing until reached the leap start\n"
 "    \n"
 "    if (leapBackward) { msRtc += 1000; leaps -= 1; } //skip   59\n"
 "    else              { msRtc -= 1000; leaps += 1; } //repeat 59\n"