Logic Machine Forum
Hour:Minutes - 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: Hour:Minutes (/showthread.php?tid=1078)



Hour:Minutes - Krstfr2k - 07.11.2017

Hello!

Could someone help me with a script to display only hour:minutes in visualization?


RE: Hour:Minutes - admin - 07.11.2017

Do you want it to be read-only or do you want to be able to change the value?


RE: Hour:Minutes - Krstfr2k - 07.11.2017

Read only


RE: Hour:Minutes - admin - 07.11.2017

The you can use a string/text object like this:
Code:
-- get current date as a table
date = os.date('*t')
-- format as HH:MM
text = string.format('%02d:%02d', date.hour, date.min)
grp.update('1/1/1', text, dt.string)