Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bad46079
Commit
bad46079
authored
Nov 13, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document struct_time and the field names.
parent
4400509a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
14 deletions
+25
-14
Doc/lib/libtime.tex
Doc/lib/libtime.tex
+25
-14
No files found.
Doc/lib/libtime.tex
View file @
bad46079
...
@@ -73,26 +73,28 @@ nonzero fraction (\UNIX{} \cfunction{select()} is used to implement
...
@@ -73,26 +73,28 @@ nonzero fraction (\UNIX{} \cfunction{select()} is used to implement
this, where available).
this, where available).
\item
\item
The time
tupl
e as returned by
\function
{
gmtime()
}
,
The time
valu
e as returned by
\function
{
gmtime()
}
,
\function
{
localtime()
}
, and
\function
{
strptime()
}
, and accepted by
\function
{
localtime()
}
, and
\function
{
strptime()
}
, and accepted by
\function
{
asctime()
}
,
\function
{
mktime()
}
and
\function
{
strftime()
}
,
\function
{
asctime()
}
,
\function
{
mktime()
}
and
\function
{
strftime()
}
,
is a tuple of 9 integers:
is a sequence of 9 integers. The return values of
\function
{
gmtime()
}
,
\function
{
localtime()
}
, and
\function
{
strptime()
}
also offer attribute
\begin{tableiii}
{
r|l|l
}{
textrm
}{
Index
}{
Field
}{
Values
}
names for individual fields.
\lineiii
{
0
}{
year
}{
(for example, 1993)
}
\lineiii
{
1
}{
month
}{
range [1,12]
}
\begin{tableiii}
{
c|l|l
}{
textrm
}{
Index
}{
Attribute
}{
Values
}
\lineiii
{
2
}{
day
}{
range [1,31]
}
\lineiii
{
0
}{
\member
{
tm
_
year
}}{
(for example, 1993)
}
\lineiii
{
3
}{
hour
}{
range [0,23]
}
\lineiii
{
1
}{
\member
{
tm
_
mon
}}{
range [1,12]
}
\lineiii
{
4
}{
minute
}{
range [0,59]
}
\lineiii
{
2
}{
\member
{
tm
_
mday
}}{
range [1,31]
}
\lineiii
{
5
}{
second
}{
range [0,61]; see
\strong
{
(1)
}
in
\function
{
strftime()
}
description
}
\lineiii
{
3
}{
\member
{
tm
_
hour
}}{
range [0,23]
}
\lineiii
{
6
}{
weekday
}{
range [0,6], Monday is 0
}
\lineiii
{
4
}{
\member
{
tm
_
min
}}{
range [0,59]
}
\lineiii
{
7
}{
Julian day
}{
range [1,366]
}
\lineiii
{
5
}{
\member
{
tm
_
sec
}}{
range [0,61]; see
\strong
{
(1)
}
in
\function
{
strftime()
}
description
}
\lineiii
{
8
}{
daylight savings flag
}{
0, 1 or -1; see below
}
\lineiii
{
6
}{
\member
{
tm
_
wday
}}{
range [0,6], Monday is 0
}
\lineiii
{
7
}{
\member
{
tm
_
yday
}}{
range [1,366]
}
\lineiii
{
8
}{
\member
{
tm
_
isdst
}}{
0, 1 or -1; see below
}
\end{tableiii}
\end{tableiii}
Note that unlike the C structure, the month value is a
Note that unlike the C structure, the month value is a
range of 1-12, not 0-11. A year value will be handled as described
range of 1-12, not 0-11. A year value will be handled as described
under ``Year 2000 (Y2K) issues'' above. A
\code
{
-1
}
argument as
under ``Year 2000 (Y2K) issues'' above. A
\code
{
-1
}
argument as
the
daylight savings flag, passed to
\function
{
mktime()
}
will usually
daylight savings flag, passed to
\function
{
mktime()
}
will usually
result in the correct daylight savings state to be filled in.
result in the correct daylight savings state to be filled in.
...
@@ -100,6 +102,9 @@ When a tuple with an incorrect length is passed to a function
...
@@ -100,6 +102,9 @@ When a tuple with an incorrect length is passed to a function
expecting a time tuple, or having elements of the wrong type, a
expecting a time tuple, or having elements of the wrong type, a
\exception
{
TypeError
}
is raised.
\exception
{
TypeError
}
is raised.
\versionchanged
[The time value sequence was changed from a tuple to a
specialized type, with the addition of attribute names
for the fields]
{
2.2
}
\end{itemize}
\end{itemize}
The module defines the following functions and data items:
The module defines the following functions and data items:
...
@@ -285,6 +290,12 @@ values; the specific values are platform-dependent as the XPG standard
...
@@ -285,6 +290,12 @@ values; the specific values are platform-dependent as the XPG standard
does not provide sufficient information to constrain the result.
does not provide sufficient information to constrain the result.
\end{funcdesc}
\end{funcdesc}
\begin{datadesc}
{
struct
_
time
}
The type of the time value sequence returned by
\function
{
gmtime()
}
,
\function
{
localtime()
}
, and
\function
{
strptime()
}
.
\versionadded
{
2.2
}
\end{datadesc}
\begin{funcdesc}
{
time
}{}
\begin{funcdesc}
{
time
}{}
Return the time as a floating point number expressed in seconds since
Return the time as a floating point number expressed in seconds since
the epoch, in UTC. Note that even though the time is always returned
the epoch, in UTC. Note that even though the time is always returned
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment