aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_constants.py
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2019-10-02 10:42:43 +0200
committerGravatar Sebastiaan Zeeff <[email protected]>2019-10-02 10:42:43 +0200
commita8b600217cb9ab4524bb307f0a6a922a0d8815be (patch)
tree2fe8881806e356b1eba3fe28044a49db2d52f942 /tests/test_constants.py
parentRemove angle brackets from ISODateTime docstring (diff)
Make ISODateTime return tz-unaware datetime
The parser we use, `dateutil.parsers.isoparse` returns a timezone- aware or timezone-unaware `datetime` object depending on whether or not the datetime string included a timezone offset specification. Since we can't compare tz-aware objects to tz-unaware objects it's better to make sure our converter is consistent in the type it will return. For now, I've chosen to return tz-unaware datetime objects, since `discord.py` also returns tz-unaware datetime objects when accessing datetime-related attributes of objects. Since we're likely to compare "our" datetime objects to discord.py-provided datetime objects, I think that's the most parsimonious option for now. Note: It's probably a good idea to open a larger discussion about using timezone-aware datetime objects throughout the library to avoid a UTC-time being interpreted as localtime. This will require a broader discussion than this commit/PR allows, though.
Diffstat (limited to 'tests/test_constants.py')
0 files changed, 0 insertions, 0 deletions