[Python-checkins] python/nondist/sandbox/datetime doc.txt,1.45,1.46
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
2002年12月11日 16:30:17 -0800
Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv30726
Modified Files:
doc.txt
Log Message:
Added docs for the timetz object. I regret signing up for this <0.7 wink>.
Index: doc.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/doc.txt,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** doc.txt 11 Dec 2002 20:57:58 -0000 1.45
--- doc.txt 12 Dec 2002 00:30:15 -0000 1.46
***************
*** 738,747 ****
- class datetimetz
- ================
-
-
class timetz
============
--- 738,838 ----
class timetz
============
+ A time object represents a (local) time of day, independent of any
+ particular day, and subject to adjustment via a tzinfo object.
+
+ Constructor:
+
+ time(hour=0, minute=0, second=0, microsecond=0, tzinfo=None)
+
+ All arguments are optional. tzinfo may be None, or an instance of
+ a tzinfo subclass. The remaining arguments may be ints or longs, in
+ the following ranges:
+
+ 0 <= hour < 24
+ 0 <= minute < 60
+ 0 <= second < 60
+ 0 <= microsecond < 1000000
+
+ If an argument outside those ranges is given, ValueError is raised.
+
+ Other constructors (class methods):
+
+ None
+
+ Class attributes:
+
+ .min
+ The earliest representable time, timetz(0, 0, 0, 0).
+
+ .max
+ The latest representable time, timetz(23, 59, 59, 999999).
+
+ .resolution
+ The smallest possible difference between non-equal timetz
+ objects, timedelta(microseconds=1).
+
+ Instance attributes (read-only):
+
+ .hour in range(24)
+ .minute in range(60)
+ .second in range(60)
+ .microsecond in range(1000000)
+ .tzinfo the object passed as the tzinfo= argument to the
+ timetz constructor, or None if none was passed.
+
+ Supported operations:
+
+ - comparison of timetz to timetz, where timetz1 is considered
+ less than timetz2 when timetz1 precedes timetz2 in time, and
+ where the timetz objects are first adjusted by subtracting
+ their UTC offsets (obtained from self.tzinfo.utcoffset(self)).
+
+ - hash, use as dict key
+
+ - pickling
+
+ - in Boolean contexts, a timetz object is considered to be true
+ if and only if it isn't equal to timetz(0)
+
+ Instance methods:
+
+ - isoformat()
+ Return a string representing the time in ISO 8601 format,
+ HH:MM:SS.mmmmmm
+ or, if self.microsecond is 0
+ HH:MM:SS
+ If self.tzinfo.utcoffset(self) does not return None, a 6-character
+ string is appended, giving the UCT offset in (signed) hours and
+ minutes:
+ HH:MM:SS.mmmmmm+HH:MM
+ or, if self.microsecond is 0
+ HH:MM:SS+HH:MM
+
+ - __str__()
+ For a timetz t, str(t) is equivalent to t.isoformat().
+
+ - strftime(format)
+ Return a string representing the time, controlled by an explicit
+ format string. Format codes for any fields other than hour, minute,
+ second and time zone should not be used, since a timetz object has
+ meaningful values only for those fields.
+ Format code %Z: If self.tzinfo is None, or if
+ self.tzinfo.tzname(self) returns None, %Z is replaced by an empty
+ string. Else %Z is replaced by the returned value, which must be
+ a string.
+ Format code %z: This is an extension to the usual set of format
+ codes. If self.tzinfo is None, or if self.tzinfo.uctoffset(self)
+ returns None, %z is replaced by an empty string. Else the return
+ value is transformed into a 5-character string of the form +HHMM or
+ -HHMM, and replaces %z, where HH is a 2-digit string giving the
+ number of UTC offset hours, and MM is a 2-digit string giving the
+ number of UTC offset minutes.
+ XXX Sheesh. This needs an example.
+
+
+ class datetimetz
+ ================