This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

How get the time correctly
#1
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)
Reply
#2
Set the LM to the correct time zone and adjust date and time to the correct values.
Reply
#3
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
Reply


Forum Jump: