Logic Machine Forum
How get the time correctly - 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: How get the time correctly (/showthread.php?tid=1014)



How get the time correctly - Carlos Padilla - 25.09.2017

Hello good day
I want to get the time and I do it, but it gives me an incorrect time to my country, how can I make time for my country



Code:
a=os.date('%c')

log(a)



RE: How get the time correctly - FatMax - 25.09.2017

Set the LM to the correct time zone and adjust date and time to the correct values.


RE: How get the time correctly - stephen.song - 26.09.2017

T=os.date()
t=os.date("%H:%M:%S")--时:分:秒
t1=os.date("%H:%M")--时:分
Y=os.date("%Y")--年
y=os.date("%y")--年缩写
m=os.date("%m")--月
W=os.date("%W")--当年第几周
w=os.date("%w")--周
D=os.date("%D")--几月几号几年
d=os.date("%d")--几号
grp.write('32/1/3', T)
grp.write('32/1/4', t)
grp.write('32/1/5', t1)
grp.write('32/1/6', Y)
grp.write('32/1/7', y)
grp.write('32/1/8', m)
grp.write('32/1/9', W)
grp.write('32/1/10', w)
grp.write('32/1/11', D)
grp.write('32/1/12', d)

you can try these