Skip to content

Commit

Permalink
[qa] use utcnow() instead of utc()
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBldy committed Aug 9, 2023
1 parent de33299 commit 0d10a4a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zou/app/utils/date_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_year_interval(year):
Get a tuple containing start date and end date for given year.
"""
year = int(year)
if year > datetime.now().year or year < 2010:
if year > datetime.utcnow().year or year < 2010:
raise WrongDateFormatException

start = datetime(year, 1, 1)
Expand All @@ -80,7 +80,7 @@ def get_month_interval(year, month):
"""
year = int(year)
month = int(month)
if year > datetime.now().year or year < 2010 or month < 1 or month > 12:
if year > datetime.utcnow().year or year < 2010 or month < 1 or month > 12:
raise WrongDateFormatException

start = datetime(year, month, 1)
Expand All @@ -94,7 +94,7 @@ def get_week_interval(year, week):
"""
year = int(year)
week = int(week)
if year > datetime.now().year or year < 2010 or week < 1 or week > 52:
if year > datetime.utcnow().year or year < 2010 or week < 1 or week > 52:
raise WrongDateFormatException
start = isoweek.Week(year, week).monday()
end = start + relativedelta.relativedelta(days=7)
Expand All @@ -109,7 +109,7 @@ def get_day_interval(year, month, day):
month = int(month)
day = int(day)
if (
year > datetime.now().year
year > datetime.utcnow().year
or year < 2010
or month < 1
or month > 12
Expand Down

0 comments on commit 0d10a4a

Please sign in to comment.