Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| python:handling_dates [2023/03/20 17:34] – created mgupton | python:handling_dates [2023/03/20 18:18] (current) – mgupton | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Handling Dates ====== | ====== Handling Dates ====== | ||
| - | Convert //datetimes// to and from strings in [[wp>ISO 8601]] format | + | Convert //datetime// values |
| <code python> | <code python> | ||
| from datetime import datetime | from datetime import datetime | ||
| Line 7: | Line 7: | ||
| dt = datetime.now() | dt = datetime.now() | ||
| - | print(dt) | + | print(type(dt)) |
| - | print(dt.isoformat()) | + | print(type(dt.isoformat())) |
| print(type(dateutil.parser.parse(' | print(type(dateutil.parser.parse(' | ||
| </ | </ | ||