[Python-checkins] python/dist/src/Doc/lib libdatetime.tex,1.4,1.5

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
2002年12月24日 08:25:32 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv27329/python/Doc/lib
Modified Files:
	libdatetime.tex 
Log Message:
tzinfo.{utcoffset,dst} can return timedelta (or integer or None).
{timetz,datetimetz}.{uctcoffset,dst} do return timedelta (or None).
Index: libdatetime.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdatetime.tex,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** libdatetime.tex	24 Dec 2002 05:41:26 -0000	1.4
--- libdatetime.tex	24 Dec 2002 16:25:29 -0000	1.5
***************
*** 774,778 ****
 isn't known, return \code{None}. Else the value returned must be
 an integer, in the range -1439 to 1439 inclusive (1440 = 24*60;
! the magnitude of the offset must be less than one day).
 
 - tzname(dt)
--- 774,780 ----
 isn't known, return \code{None}. Else the value returned must be
 an integer, in the range -1439 to 1439 inclusive (1440 = 24*60;
! the magnitude of the offset must be less than one day), or a
! \class{timedelta} object representing a whole number of minutes
! in the same range.
 
 - tzname(dt)
***************
*** 790,800 ****
 Return the DST offset, in minutes east of UTC, or \code{None} if
 DST information isn't known. Return 0 if DST is not in effect.
! If DST is in effect, return an int (or long), in the range -1439
! to 1439 inclusive. Note that DST offset, if applicable, has
 already been added to the UTC offset returned by
 \method{utcoffset()}, so there's no need to consult \method{dst()}
 unless you're interested in displaying DST info separately. For
! example, \method{datetimetz.timetuple()} calls its \class{tzinfo}
! object's \method{dst()} method to determine how the
 \member{tm_isdst} flag should be set.
 
--- 792,803 ----
 Return the DST offset, in minutes east of UTC, or \code{None} if
 DST information isn't known. Return 0 if DST is not in effect.
! If DST is in effect, return the offset as an integer or
! \class{timedelta} object (see \method{utcoffset()} for details).
! Note that DST offset, if applicable, has
 already been added to the UTC offset returned by
 \method{utcoffset()}, so there's no need to consult \method{dst()}
 unless you're interested in displaying DST info separately. For
! example, \method{datetimetz.timetuple()} calls its \member{tzinfo}
! member's \method{dst()} method to determine how the
 \member{tm_isdst} flag should be set.
 
***************
*** 900,904 ****
 - utcoffset()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
! \code{tzinfo.utcoffset(self)}.
 
 - tzname():
--- 903,908 ----
 - utcoffset()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
! \code{tzinfo.utcoffset(self)} converted to a \class{timedelta}
! object.
 
 - tzname():
***************
*** 908,912 ****
 - dst()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
! \code{tzinfo.dst(self)}.
 
 
--- 912,916 ----
 - dst()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
! \code{tzinfo.dst(self)} converted to a \class{timedelta} object.
 
 
***************
*** 1025,1030 ****
 \item
 If both are aware \class{datetimetz} objects, a-b acts as if a and b were
! first converted to UTC datetimes (by subtracting a.utcoffset()
! minutes from a, and b.utcoffset() minutes from b), and then doing
 \class{datetime} subtraction, except that the implementation never
 overflows.
--- 1029,1034 ----
 \item
 If both are aware \class{datetimetz} objects, a-b acts as if a and b were
! first converted to UTC datetimes (by subtracting \code{a.utcoffset()}
! minutes from a, and \code{b.utcoffset()} minutes from b), and then doing
 \class{datetime} subtraction, except that the implementation never
 overflows.
***************
*** 1078,1082 ****
 - utcoffset()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
! \code{tzinfo.utcoffset(self)}.
 
 - tzname()
--- 1082,1087 ----
 - utcoffset()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
! \code{tzinfo.utcoffset(self)} converted to a \class{timedelta}
! object.
 
 - tzname()
***************
*** 1086,1090 ****
 - dst()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
! \code{tzinfo.dst(self)}.
 
 - timetuple()
--- 1091,1096 ----
 - dst()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
! \code{tzinfo.dst(self)} converted to a \class{timedelta}
! object.
 
 - timetuple()
***************
*** 1173,1178 ****
 number of UTC offset hours, and MM is a 2-digit string giving the
 number of UTC offset minutes. For example, if
! \method{utcoffset()} returns -180, \code{\%z} is replaced with the
! string \code{'-0300'}.
 
 \item[\code{\%Z}]
--- 1179,1184 ----
 number of UTC offset hours, and MM is a 2-digit string giving the
 number of UTC offset minutes. For example, if
! \method{utcoffset()} returns \code{timedelta(hours=-3, minutes=-30}},
! \code{\%z} is replaced with the string \code{'-0330'}.
 
 \item[\code{\%Z}]
***************
*** 1235,1239 ****
 return ints:
 
! For date, datetime, and \class{datetimetz} instances:
 PyDateTime_GET_YEAR(o)
 PyDateTime_GET_MONTH(o)
--- 1241,1245 ----
 return ints:
 
! For \class{date}, \class{datetime}, and \class{datetimetz} instances:
 PyDateTime_GET_YEAR(o)
 PyDateTime_GET_MONTH(o)
***************
*** 1246,1250 ****
 PyDateTime_DATE_GET_MICROSECOND(o)
 
! For time and \class{timetz} instances:
 PyDateTime_TIME_GET_HOUR(o)
 PyDateTime_TIME_GET_MINUTE(o)
--- 1252,1256 ----
 PyDateTime_DATE_GET_MICROSECOND(o)
 
! For \class{time} and \class{timetz} instances:
 PyDateTime_TIME_GET_HOUR(o)
 PyDateTime_TIME_GET_MINUTE(o)

AltStyle によって変換されたページ (->オリジナル) /