[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: date arithmetic?
- From: PA <petite.abeille@...>
- Date: Wed, 24 Aug 2005 20:58:11 +0200
On Aug 24, 2005, at 14:01, Luiz Henrique de Figueiredo wrote:
I'm probably missing something but I think you can simply add the
appropriate
offset to os.time, as in:
I guess the crux of the issue is 'appropriate offset':
March 1, 2005 - 1 month = February 1, 2005
March 28, 2005 - 1 month = February 28, 2005
April 15, 2005 - 1 month = March 15, 2005
What would be the proper value of '1 month'?
In any case, directly manipulating the os.date's table elements seems
to yield sensible results so far.
FWIW, here is a list of the currently implemented functions:
add, compare, date, dateWithJulianDay, dateWithValues, day, dayDate,
dayEndDate, dayOfWeek, dayOfYear, equals, hashCode, hour, init, isDST,
julianDay, minute, month, monthDate, monthEndDate, second, time,
timeZone, timeZoneOffset, toString, utc, utcDate, week, weekDate,
weekEndDate, weeksInMonth, year, yearDate, yearEndDate
http://dev.alt.textdrive.com/file/lu/LUDate.lua
Cheers
--
PA, Onnay Equitursay
http://alt.textdrive.com/