> On Behalf Of Tim Bird
> Sent: March 5, 2003 3:15 PM
> Subject: Re: [Moin-devel] Date util
> --- Nick Trout <ntrout@...> wrote:
> > It would be useful to have more date functionality in Moin (maybe
> > MoinMoin.util.date.py) e.g. functions so you can work out how many
> > days
> > there are between two dates, whether a given date is before, after
> > or
> > between to other dates.
> I believe the page dates are encoded in "seconds since the epoch"
> (Jan 1, 1970), so they should be pretty easy to compare when in
> raw form. I thought the standard python time module had features
> for all kinds of date-related functions, but I'm not sure and
> I can't look at it right now.
There are some issues with the time module. time.strptime (which
converts text dates to time format) only works on unix (and sounds flaky
even on there). If I want to do a query, say, is a time within the last
calender month, or within the last 10 working days, or is a date between
two given dates. I have to do all sorts of stuff, which could be
reuseable. And, if you want to do calculations on working days, with
holidays taken into account the problem gets worse. I don't think a
wiki.date util library should be too general but there could be some
useful functionality that could be shared.