[Python-checkins] CVS: python/nondist/sandbox/datetime datetime.py,1.17,1.18
Guido van Rossum
gvanrossum@users.sourceforge.net
2002年3月02日 19:21:47 -0800
Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory usw-pr-cvs1:/tmp/cvs-serv4386
Modified Files:
datetime.py
Log Message:
Add some XXX comments about brokenness relating to ctime().
Index: datetime.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/datetime.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** datetime.py 3 Mar 2002 02:50:52 -0000 1.17
--- datetime.py 3 Mar 2002 03:21:45 -0000 1.18
***************
*** 380,383 ****
--- 380,384 ----
h, m = divmod(-self.__tzoffset, 60)
h = -h
+ # XXX This is broken! ctime() renormalizes to local time. :-(
return self.ctime() + " %+03d:%02d" % (h, m)
***************
*** 487,490 ****
--- 488,500 ----
# Formatting methods
+
+ # XXX These shouldn't depend on time.localtime(), because that
+ # clips the usable dates to [1970 .. 2038). At least ctime() is
+ # easily done without using strftime() -- that's better too because
+ # strftime("%c", ...) is locale specific.
+
+ # XXX An additional question is whether ctime() should renormalize
+ # to local time, or display the time as entered (which may be
+ # confusing since it doesn't show the timezone).
def ctime(self):