[Python-Dev] datetime module enhancements

Jon Ribbens jon+python-dev at unequivocal.co.uk
Fri Mar 9 22:36:20 CET 2007

"\"Martin v. Löwis\"" <martin at v.loewis.de> wrote:
> There are know problems comparing durations (e.g. is 30 days more
> or less than a month?). For time stamps, there is no issue. For
> calender dates, there are again problems, in particular with time
> zones.

Python durations (datetime.timedelta) do not support the concept of
"months", so that's not an issue. The timedelta type only supports
durations that are a fixed number of seconds.

I don't see what the issue with time zones would be? Surely you just
convert to the same time zone and then compare?

> What I don't know (because I never used it) is whether the datetime
> module implements time stamps. If it does (i.e. no durations,
> no time zones, no issues with leap seconds), then supporting a
> total order seems reasonable.

It supports converting *from* timestamps, but not *to* timestamps,
which is the subject of a feature request I submitted the other day
(1673409) ;-)

More information about the Python-Dev mailing list