Python/Datetime: Difference between revisions
< Python
Jump to navigation
Jump to search
| Line 14: | Line 14: | ||
! TODO || Code | ! TODO || Code | ||
|- | |- | ||
| ISO | | To ISO string || | ||
<source lang="python3"> | <source lang="python3"> | ||
</source> | </source> | ||
|- | |- | ||
| RFC | | To RFC string || | ||
<source lang="python3"> | <source lang="python3"> | ||
</source> | </source> | ||
Revision as of 08:02, 18 May 2018
Parsing
| TODO | Code |
|---|---|
| Parse RFC Time |
import datetime
datetime.datetime.strptime(s, '%a, %d %b %Y %H:%M:%S GMT')
|
Formatting
| TODO | Code |
|---|---|
| To ISO string | |
| To RFC string |