department-of-veterans-affairs / notification-api

Notification API
MIT License
16 stars 9 forks source link

Use America/New_York time zone by default #1350

Open kalbfled opened 1 year ago

kalbfled commented 1 year ago

User Story - Business Need

User Story(ies)

As a VA Notify developer, I want the application to default to using a U.S. time zone So that actions of a foreign government don't affect VA Notify.

Additional Info and Resources

VA Notify, as a fork of a Canadian repository, uses the time zone "America/Toronto" by default. We should use "America/New_York", as is now the default for Celery since merging PR 870. These two time zones currently have identical attributes, but that could change. For example, Canada could decide to abandon daylight savings time.

...notification-api$ grep -rni Toronto .
./app/commands.py:313:                        (n.created_at at time zone 'UTC' at time zone 'America/Toronto')::timestamp::date as bst_date,
./app/commands.py:345:                    and n.created_at >= (date :start + time '00:00:00') at time zone 'America/Toronto'
./app/commands.py:347:                    and n.created_at < (date :end + time '00:00:00') at time zone 'America/Toronto' at time zone 'UTC'
./app/commands.py:434:                    (n.created_at at time zone 'UTC' at time zone 'America/Toronto')::timestamp::date as bst_date,
./app/commands.py:444:                where n.created_at >= (date :start + time '00:00:00') at time zone 'America/Toronto' at time zone 'UTC'
./app/commands.py:445:                    and n.created_at < (date :end + time '00:00:00') at time zone 'America/Toronto' at time zone 'UTC'
./app/commands.py:567:                    created_at >= (date :start + time '00:00:00') at time zone 'America/Toronto'
./app/commands.py:569:                    and created_at < (date :end + time '00:00:00') at time zone 'America/Toronto' at time zone 'UTC'"""
./app/dao/date_util.py:42:    return pytz.timezone(os.getenv('TIMEZONE', 'America/Toronto')).localize(
./app/utils.py:10:local_timezone = pytz.timezone(os.getenv("TIMEZONE", "America/Toronto"))
./app/utils.py:87:      - then convert the timezone to BST (or America/Toronto)
./app/utils.py:93:        func.timezone(os.getenv("TIMEZONE", "America/Toronto"), func.timezone("UTC", column))
./migrations/versions/0183_alter_primary_key.py:46:        (datum + TIME '00:00:00') at Time zone 'America/Toronto' at TIME zone 'utc' as utc_daytime_start,    -- convert bst time to utc time
./migrations/versions/0183_alter_primary_key.py:47:        (datum + TIME '24:00:00') at Time zone 'America/Toronto' at TIME zone 'utc' as utc_daytime_end

Engineering Checklist

Acceptance Criteria

npmartin-oddball commented 2 weeks ago

Keeping.