Datetime utility functions

Dan Bishop danb_83 at yahoo.com
Tue Sep 16 19:24:04 EDT 2003


paul.moore at atosorigin.com (Paul Moore) wrote in message news:<182bcf76.0309150707.3a8c0482 at posting.google.com>...
> I was just writing some code which did date/time manipulations, and I
> found that the Python 2.3 datetime module does not supply a number of
> fairly basic functions. I understand the reasoning (the datetime
> module provides a set of datatypes, and doesn't attempt to get into
> the murky waters of date algorithms) but as these things can be quite
> tricky to get right, I was wondering if anyone has already implemented
> any date algorithms, or alternatively if I'd missed some easy way of
> doing what I'm after.
>
> [description of needed functions]

I wrote a module just like that at my last job.  Given a date object,
you could find the first or last day of the month, quarter, or year. 
There were also functions to answer questions like "What was the date
5 months ago?" or "What date is the first Monday after October 8?"

Unfortunately, I don't have a copy of the source code here.




More information about the Python-list mailing list