PEP 410: rephrase doc about datetime.datetime and datetime.timedelta

This commit is contained in:
Victor Stinner 2012-02-06 23:45:48 +01:00
parent 68a77c80f0
commit bfc65dd872
1 changed files with 10 additions and 10 deletions

View File

@ -126,14 +126,15 @@ datetime.datetime
datetime.datetime only supports microsecond resolution, but can be enhanced
to support nanosecond.
datetime.datetime has issues:
datetime.datetime has issues with timezone. For example, a datetime object
without timezone and a datetime with a timezone cannot be compared.
- there is no easy way to convert it into "seconds since the epoch"
- any broken-down time has issues of time stamp ordering in the
duplicate hour of switching from DST to normal time
- time zone support is flaky-to-nonexistent in the datetime module
datetime.datetime has ordering issues with daylight saving time (DST) in the
duplicate hour of switching from DST to normal time.
datetime.datetime is also more complex than a simple number.
datetime.datetime is not as well integrated than Epoch timestamps, some
functions don't accept this type as input. For example, os.utime() expects a
tuple of Epoch timestamps.
datetime.timedelta
------------------
@ -141,10 +142,9 @@ datetime.timedelta
As datetime.datetime, datetime.timedelta only supports microsecond resolution,
but can be enhanced to support nanosecond.
Even if datetime.timedelta have most criteria, it was not selected because it
is more complex than a simple number and is not accepted by functions getting
timestamp inputs.
datetime.timedelta is not as well integrated than Epoch timestamps, some
functions don't accept this type as input. For example, os.utime() expects a
tuple of Epoch timestamps.
.. _tuple-integers: