fix: use aware datetimes everywhere
Enables DTZ rules, which require the use of timezone-aware datetimes everywhere.
Previously some of the displayed times would've only been correct if the bot runs in UTC, since disnake assumes all naive datetimes are local time.
Welp, turns out this will only work on >=3.11. Earlier versions of fromisoformat don't actually parse iso8601-formatted strings, contrary to the name.
Alternatives include:
-
arrow.get(t).datetime(56.7us) -
datetime.strptime(t, "%Y-%m-%dT%H:%M:%S%z")(8.1us)- note the
%zinstead ofZ
- note the
-
dateutil.parser.isoparse(5.2us)- arrow already depends on dateutil, fwiw
Welp, turns out this will only work on >=3.11. Earlier versions of
fromisoformatdon't actually parse iso8601-formatted strings, contrary to the name.Alternatives include:
* `arrow.get(t).datetime` (56.7us) * `datetime.strptime(t, "%Y-%m-%dT%H:%M:%S%z")` (8.1us) * note the `%z` instead of `Z` * `dateutil.parser.isoparse` (5.2us) * arrow already depends on dateutil, fwiw
feel free to use striptime or dateutil.parser. I think I'm already using datetime.strptime in the majority of places.
Fixed in https://github.com/onerandomusername/monty-python/pull/240/commits/38f73ddf768d48583b86b95e6f9c86461a384242.
Could you please rebase with signed commits?
Could you please rebase with signed commits?
Done.