Logic Machine Forum
1 Day day later of date and 1 hour later of time - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: 1 Day day later of date and 1 hour later of time (/showthread.php?tid=5257)



1 Day day later of date and 1 hour later of time - savaskorkmaz - 20.02.2024

Hi I need to calculated 1 day later of the dateĀ  and 1 hour later of the time and writeeach values to a groupp adddress.

How can i calculate via script ?


RE: 1 Day day later of date and 1 hour later of time - admin - 20.02.2024

Code:
-- get current timestamp (in seconds) and add 25 hours to it
ts = os.time()
ts = ts + 25 * 60 * 60

-- convert timestamp to table
date = os.date('*t', ts)

-- update objects with 3 byte date / time data types
grp.checkupdate('32/0/20', date)
grp.checkupdate('32/0/21', date)