Skip to main content
12 events
when toggle format what by license comment
Oct 16, 2023 at 6:58 history edited Klesun CC BY-SA 4.0
Add link to the documentation of the mentioned `fromisoformat()` function
Jun 23, 2023 at 7:41 history edited FObersteiner CC BY-SA 4.0
update benchmark with python 3.11 option
Jun 15, 2023 at 19:54 comment added mike rodent Totally different point now (I understand a bit more about "awareness"). But I've noted in the docs "Changed in version 3.11: Previously, this method only supported formats that could be emitted by date.isoformat() or datetime.isoformat()." and "corresponding to a date_string in any valid ISO 8601 format". That might actually not be what one wants. The fromisoformat of datetime.date is more explicit: "Return a date corresponding to a date_string given in any valid ISO 8601 format... " ... and it gives some surprising examples of strings which work which are not simple YYYY-MM-DD.
Jan 23, 2023 at 8:06 history edited FObersteiner CC BY-SA 4.0
hint to %z
Jan 6, 2023 at 10:15 history edited FObersteiner CC BY-SA 4.0
wording
Dec 28, 2022 at 13:19 history edited FObersteiner CC BY-SA 4.0
added Python 3.11 option
Jun 27, 2022 at 9:09 history edited FObersteiner CC BY-SA 4.0
formatting
Mar 28, 2021 at 10:00 comment added FObersteiner @mikerodent: the point is that fromisoformat parses +00:00 but not Z to aware datetime with tzinfo being UTC. If your input e.g. ends with Z+00:00, you can just remove the Z before feeding it into fromisoformat. Other UTC offsets like e.g. +05:30 will then be parsed to a static UTC offset (not an actual time zone).
Jan 13, 2021 at 8:15 history edited FObersteiner CC BY-SA 4.0
updated timeit; added dateutil.parser.parse
Nov 30, 2020 at 7:30 history edited FObersteiner CC BY-SA 4.0
wording, benchmark update
Aug 10, 2020 at 7:24 history edited FObersteiner CC BY-SA 4.0
formatting
Jul 7, 2020 at 6:34 history answered FObersteiner CC BY-SA 4.0