mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 17:31:34 -05:00
April 1st is in British summer time, ie 1hr ahead of UTC. The database stores everything in UTC, so for accurate comparisions we need to make sure that `get_financial_year()` returns a UTC, datetime-aware timestamp that is 1hr ahead of midnight. This also means that when we group notifications by month, the months need to be in BST. So the line between one year and another is actually 01:00 on April 1st, _not_ 00:00 on April 1st. There’s no way we’ve found to do this in SQLAlchemy or raw Postgres, especially because we don’t store the timestamps with a timezone in the database. So the grouping and summing of the notifications has to be done in Python.