pull timezone from utils for other pytz instances

This commit is contained in:
stvnrlly
2022-11-16 16:53:55 -05:00
parent e6d30394ba
commit c8533ae524
2 changed files with 5 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import pytz
from notifications_utils.timezones import (
convert_local_timezone_to_utc,
convert_utc_to_local_timezone,
local_timezone
)
@@ -50,7 +51,7 @@ def get_april_fools(year):
:param year: the year to calculate the April 1, 00:00 BST for
:return: the datetime of April 1 for the given year, for example 2016 = 2016-03-31 23:00:00
"""
return pytz.timezone(getenv("TIMEZONE", "America/New_York")).localize(
return local_timezone.localize(
datetime(year, 4, 1, 0, 0, 0)).astimezone(pytz.UTC).replace(tzinfo=None)