Local time.
My time is CET +2 hours GMT.
When I run the program and ask for the time, I always get information that the current time is 2 hours shifted.
When the watch shows 18:00. The program running in MicroStudio says it is 4:00 PM.
I am using MicrosoftStudio offline version, Firefox 102, the operating system is Windows 8.1.
This is the code I use for time testing.
MicroScript is missing a variable to query for time zone offset.
TimeTest = class
constructor = function()
this.h = 0
this.m = 0
this.s = 0
end
now = function()
local time = system.time() % 86400000
// 24 h * 60 m * 60 s * 1000
local ms = time % 1000
time = ( time - ms ) / 1000
s = time % 60
time = ( time - s ) / 60
m = time % 60
time = ( time - m ) / 60
h = time
end
nowH = function()
return h
end
nowM = function()
return m
end
nowS = function()
return s
end
end
init = function()
timeTest = new TimeTest()
timeTest.now()
lastSec = timeTest.nowS()
end
update = function()
timeTest.now()
if timeTest.nowS() != lastSec then
lastSec = timeTest.nowS()
print( 'Time h: ' + timeTest.nowH()+ ' m: '+ timeTest.nowM() + ' s: ' + timeTest.nowS())
end
end
draw = function()
end