diff options
author | Wolfgang Müller | 2021-05-02 12:38:56 +0200 |
---|---|---|
committer | Wolfgang Müller | 2021-05-02 12:38:56 +0200 |
commit | f95a23e0e5c23b7ec13e63501b6ab6df540cb695 (patch) | |
tree | 107c181ce88abf258a4fa1cadacdb103d12f63be /setup.py | |
parent | 0b6ce2c57d53d947b15f0d429d2216df61ce3783 (diff) | |
download | quarg-f95a23e0e5c23b7ec13e63501b6ab6df540cb695.tar.gz |
Handle timezones correctly
Quassel uses UTC message timestamps in its database, but does not save
any timezone information along with them. Up until now, we were reading
those timestamps from the database naively - resulting in datetime
objects that could not be identified as UTC.
The same happened with timestamps we got from dateutil.isoparse. If the
user did not specify an offset explicitly, the timestamp would be parsed
and passed to the program "as is", effectively being interpreted as UTC
because they were compared to database timestamps.
This commit will ensure that the correct timezone is saved for every
datetime object we encounter. Timestamps from the database are marked as
UTC. If the user does not explicitly specify an offset, the timestamp is
assumed to be in local time.
Furthermore, when printing out message timestamps, make sure to convert
them to the user's local timezone first.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions