aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/quarg/utils.py (unfollow)
Commit message (Collapse)AuthorLines
2021-05-02Handle timezones correctlyWolfgang Müller-0/+4
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.
2021-04-28Split errx and parse_isodate out into utils.pyWolfgang Müller-0/+15
We're going to need this for an upcoming commit that moves all argparse.Action classes to its own file.