lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

out of my mind (cases could be outer way round, not sure):"%Y %M %D %h %m %s")

will give you:
year month day hours minutes seconds

for more, see the Ansi C date function description, it should be possible to
find that on the web

-----Ursprüngliche Nachricht-----
[] Im Auftrag von PA
Gesendet: Dienstag, 23. August 2005 22:24
An: Lua list
Betreff: date arithmetic?


How does one do date arithmetic in Lua?

Right now, I'm manipulating the's table directly:

local aDate = "*t" )

print( "%x", os.time( aDate ) ) )

-- find the end of the month
aDate.month = aDate.month + 1 = 0

print( "%x", os.time( aDate ) ) )

 > 08/23/05
 > 08/31/05

Seems to work, but I'm not sure if this is by luck or design.. :)




PA, Onnay Equitursay