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
9ca35ec9
Commit
9ca35ec9
authored
Jan 28, 2001
by
Eric S. Raymond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instructive example for strftime(); how to generate RFC822 dates.
parent
d9b9ac85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
Doc/lib/libtime.tex
Doc/lib/libtime.tex
+16
-0
No files found.
Doc/lib/libtime.tex
View file @
9ca35ec9
...
...
@@ -224,6 +224,22 @@ Notes:
seconds and the (very rare) double leap seconds.
\end{description}
Here is an example, a format for dates compatible with that specified
in the
\rfc
{
822
}
Internet email standard.
\footnote
{
The use of
\%
Z is now
deprecated, but the
\%
z escape that expands to the preferred
hour/minute offset is not supported by all ANSI C libraries. Also,
a strict reading of the original 1982
\rfc
{
822
}
standard calls for
a two-digit year (
\%
y rather than
\%
Y), but practice moved to
4-digit years long before the year 2000.
}
\begin{verbatim}
>>> from time import *
>>> strftime("
\%
a,
\%
d
\%
b
\%
Y
\%
H:
\%
M:
\%
S
\%
Z", localtime())
'Sat, 27 Jan 2001 05:15:05 EST'
>>>
\end{verbatim}
Additional directives may be supported on certain platforms, but
only the ones listed here have a meaning standardized by ANSI C.
...
...
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