FormatTime inside of Loop not working
Posted: 13 May 2024, 07:58
Does anyone know why this FormatTime within this loop does not work? The localTime variable increments as expected by 1 hour each pass and shows in the message box, but the TimeofDay variable always shows the result from the very first pass of the loop?
Code: Select all
#Include <JSON>
FileRead, var, C:\Program Files (x86)\Cinemar\Batch Files\openweathermap.txt ; get JSON string
obj := JSON.load(var) ; load string into object
loop, 4
{
unixTime := obj.hourly[A_Index].dt
time := 1970
time += unixTime, s
utcTime := time
;diff -= A_NowUTC, h
time += -3, h
localTime := time
FormatTime, TimeofDay, localTime, h tt
msgbox, % "localTime: " . localTime . "`nTime of Day: " . TimeofDay
}