[Python-checkins] python/dist/src/Misc NEWS,1.619,1.620
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Thu, 23 Jan 2003 11:58:04 -0800
Update of /cvsroot/python/python/dist/src/Misc
In directory sc8-pr-cvs1:/tmp/cvs-serv6005/python/Misc
Modified Files:
NEWS
Log Message:
Reimplemented datetime.now() to be useful.
Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.619
retrieving revision 1.620
diff -C2 -d -r1.619 -r1.620
*** NEWS 22 Jan 2003 18:17:25 -0000 1.619
--- NEWS 23 Jan 2003 19:58:01 -0000 1.620
***************
*** 83,86 ****
--- 83,97 ----
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