summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-01-23 19:58:02 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-01-23 19:58:02 (GMT)
commit10cadce41ec7b94aafc11b4f2c9cfb7587f5b81d (patch)
treea08fd27ddaa04db1b7cad9c552b08fd964e53a68 /Misc/NEWS
parent250684ddd8223de98b5944d13e89a12673d0a51a (diff)
downloadcpython-10cadce41ec7b94aafc11b4f2c9cfb7587f5b81d.zip
cpython-10cadce41ec7b94aafc11b4f2c9cfb7587f5b81d.tar.gz
cpython-10cadce41ec7b94aafc11b4f2c9cfb7587f5b81d.tar.bz2
Reimplemented datetime.now() to be useful.
Diffstat (limited to 'Misc/NEWS')
-rw-r--r--Misc/NEWS11
1 files changed, 11 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 780bf5a..39ebd93 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -82,6 +82,17 @@ Extension modules
creativity of political time zone fiddling appears unbounded -- fromutc()
allows the highly motivated to emulate any scheme expressible in Python.
+ datetime.now(): The optional tzinfo argument was undocumented (that's
+ repaired), and its name was changed to tz ("tzinfo" is overloaded enough
+ already). With a tz argument, now(tz) used to return the local date
+ and time, and attach tz to it, without any conversion of date and time
+ members. This was less than useful. Now now(tz) returns the current
+ date and time as local time in tz's time zone, akin to
+ tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
+ where "utc" is an instance of a tzinfo subclass modeling UTC. Without
+ a tz argument, now() continues to return the current local date and time,
+ as a naive datetime object.
+
The constructors building a datetime from a timestamp could raise
ValueError if the platform C localtime()/gmtime() inserted "leap
seconds". Leap seconds are ignored now. On such platforms, it's