[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: date arithmetic?
- From: PA <petite.abeille@...>
- Date: Tue, 23 Aug 2005 22:23:42 +0200
Hello,
How does one do date arithmetic in Lua?
Right now, I'm manipulating the os.date's table directly:
local aDate = os.date( "*t" )
print( os.date( "%x", os.time( aDate ) ) )
-- find the end of the month
aDate.month = aDate.month + 1
aDate.day = 0
print( os.date( "%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.. :)
Thoughts?
TIA!
Cheers
--
PA, Onnay Equitursay
http://alt.textdrive.com/