Time

Post Reply
balrod
Posts: 1
Joined: Wed Jan 26, 2011 12:12 am

Time

Post by balrod » Wed Jan 26, 2011 12:14 am

Is it possible to set variable with current time and do normal math calculations with it? if so how can it be done?

csmall
Posts: 20
Joined: Wed Jan 12, 2011 9:36 pm

Re: Time

Post by csmall » Fri Jan 28, 2011 5:24 am

lua has os.time() and os.date() functions built-in so you can get the date or play around with it. You probably use os.time() first then add etc and then convert it to a normal string with os.date()
Code: [show] | [select all] lua
print ( os.date("%c").."\n"..os.date("%c",os.time()+60))
Fri Jan 28 16:20:59 2011
Fri Jan 28 16:21:59 2011

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: Time

Post by Denarii » Sat Jan 29, 2011 12:01 am


Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests