[Python-Dev] dateutil (original) (raw)

Brett C. bac at OCF.Berkeley.EDU
Thu Mar 11 14:44:59 EST 2004


Gerrit wrote:

Gustavo Niemeyer wrote:

Yes, it's time for the classical question. ;-)

What's your opinion about the inclusion of the dateutil[1] extension in the standard library? I am in favour of including something like DatuUtil in the standard library. I need it often enough, e.g., to find out out when two weeks after 24 Feb is is easier with DateUtil than with datetime, and I think datetime lacks a strptime.

You're right, Gerrit, strptime is not in datetime and it was a conscious decision by Tim and Guido.

And if you want a poor man's way of finding the date a specific number of days past a date you can add those number of days to the day of the year value and then pass in the year and day of year into strptime and it will calculate the new date for you. Roundabout, yes, but it works. =) Obviously DateUtil is a much better way to handle this.

IMO it should be possible to do all date/time arithmetic without the time module; I don't like the time module.

I personally would not mind seeing the time module end up with its usage being relegated to getting time information from the OS and moving all other functionality to datetime.

-Brett



More information about the Python-Dev mailing list