[Python-checkins] python/nondist/sandbox/datetime doc.txt,1.57,1.58
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Sun, 15 Dec 2002 19:58:53 -0800
- Previous message: [Python-checkins] python/nondist/sandbox/datetime datetime.c,1.76,1.77 doc.txt,1.56,1.57 test_datetime.py,1.70,1.71
- Next message: [Python-checkins] python/dist/src/Lib rexec.py,1.45,1.46 ihooks.py,1.14,1.15
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv27923
Modified Files:
doc.txt
Log Message:
Added issue about timezone conversions.
Index: doc.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/doc.txt,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** doc.txt 16 Dec 2002 03:34:21 -0000 1.57
--- doc.txt 16 Dec 2002 03:58:51 -0000 1.58
***************
*** 1,4 ****
--- 1,26 ----
TODO/OPEN
=========
+ - The Python implementation has XXX comments, and so does the Wiki,
+ saying that timezone conversion APIs should be defined. How about
+ this for a datetimetz method:
+
+ newtz(tzinfo)
+ Convert to a new time zone. In dt.newtz(tz), an exception is raised
+ if dt is naive, tz does not implement utcoffset(), or tz.utcoffset()
+ returns None.
+
+ Else a datetimetz is returned with tzinfo=tz, converting the date
+ and time fields to local time in the tz time zone. This is
+ equivalent to:
+
+ def newtz(self, tzinfo):
+ t = self - (self.utcoffset() - tzinfo.utcoffset())
+ return datetimetz(t.year, t.month, t.day,
+ t.hour, t.minute, t.second,
+ t.microsecond, tzinfo=tzinfo)
+
+ Note that this may overflow if dt.year is MINYEAR or MAXYEAR and
+ the adjustments spill over a year boundary.
+
- The Python implementation is missing docstrings in many places.
- Previous message: [Python-checkins] python/nondist/sandbox/datetime datetime.c,1.76,1.77 doc.txt,1.56,1.57 test_datetime.py,1.70,1.71
- Next message: [Python-checkins] python/dist/src/Lib rexec.py,1.45,1.46 ihooks.py,1.14,1.15
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]