02.07.2021, 21:20
(24.04.2021, 18:53)mishoboss Wrote: Is there a smart way to get the local time using os.date(), including the DST (Daylight Saving Time)? I would not like to add a hard-coded integer to the timestamp, but instead use something that calculates it for me, based on the timezone and taking account the DST.
Actually, is there a way to set the timezone in LogicMachine, so the local time of os.date() is correct?
Only os.date() reports the right time back for timezone. None of the %r or %X or %z or %Z works as they should according to strftime - no matter what is set in timezone in Utilities > Date and time.
You can get the right time for timezone by extracting the time from os.date()
ef:
TimeOfDayStr = string.match(os.date(), "%d%d:%d%d:%d%d")