@@ -73,33 +73,38 @@ \section{\module{time} ---
7373this, where available).
7474
7575\item
76- The time tuple as returned by \function {gmtime()},
76+ The time value as returned by \function {gmtime()},
7777\function {localtime()}, and \function {strptime()}, and accepted by
7878\function {asctime()}, \function {mktime()} and \function {strftime()},
79- is a tuple of 9 integers:
80-
81- \begin {tableiii }{r|l|l}{textrm}{Index}{Field}{Values}
82- \lineiii {0}{year}{(for example, 1993)}
83- \lineiii {1}{month}{range [1,12]}
84- \lineiii {2}{day}{range [1,31]}
85- \lineiii {3}{hour}{range [0,23]}
86- \lineiii {4}{minute}{range [0,59]}
87- \lineiii {5}{second}{range [0,61]; see \strong {(1)} in \function {strftime()} description}
88- \lineiii {6}{weekday}{range [0,6], Monday is 0}
89- \lineiii {7}{Julian day}{range [1,366]}
90- \lineiii {8}{daylight savings flag}{0, 1 or -1; see below}
79+ is a sequence of 9 integers. The return values of \function {gmtime()},
80+ \function {localtime()}, and \function {strptime()} also offer attribute
81+ names for individual fields.
82+
83+ \begin {tableiii }{c|l|l}{textrm}{Index}{Attribute}{Values}
84+ \lineiii {0}{\member {tm_year}}{(for example, 1993)}
85+ \lineiii {1}{\member {tm_mon}}{range [1,12]}
86+ \lineiii {2}{\member {tm_mday}}{range [1,31]}
87+ \lineiii {3}{\member {tm_hour}}{range [0,23]}
88+ \lineiii {4}{\member {tm_min}}{range [0,59]}
89+ \lineiii {5}{\member {tm_sec}}{range [0,61]; see \strong {(1)} in \function {strftime()} description}
90+ \lineiii {6}{\member {tm_wday}}{range [0,6], Monday is 0}
91+ \lineiii {7}{\member {tm_yday}}{range [1,366]}
92+ \lineiii {8}{\member {tm_isdst}}{0, 1 or -1; see below}
9193\end {tableiii }
9294
9395Note that unlike the C structure, the month value is a
9496range of 1-12, not 0-11. A year value will be handled as described
95- under `` Year 2000 (Y2K) issues'' above. A \code {-1} argument as
97+ under `` Year 2000 (Y2K) issues'' above. A \code {-1} argument as the
9698daylight savings flag, passed to \function {mktime()} will usually
9799result in the correct daylight savings state to be filled in.
98100
99101When a tuple with an incorrect length is passed to a function
100102expecting a time tuple, or having elements of the wrong type, a
101103\exception {TypeError} is raised.
102104
105+ \versionchanged [The time value sequence was changed from a tuple to a
106+ specialized type, with the addition of attribute names
107+ for the fields]{2.2}
103108\end {itemize }
104109
105110The module defines the following functions and data items:
@@ -285,6 +290,12 @@ \section{\module{time} ---
285290does not provide sufficient information to constrain the result.
286291\end {funcdesc }
287292
293+ \begin {datadesc }{struct_time}
294+ The type of the time value sequence returned by \function {gmtime()},
295+ \function {localtime()}, and \function {strptime()}.
296+ \versionadded {2.2}
297+ \end {datadesc }
298+
288299\begin {funcdesc }{time}{}
289300Return the time as a floating point number expressed in seconds since
290301the epoch, in UTC. Note that even though the time is always returned
0 commit comments