Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
diceroll123 committed Nov 6, 2023
1 parent 5f85532 commit f54d96e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions neofoodclub/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,16 @@ def get_dst_offset(today: datetime.datetime) -> datetime.timedelta:
This is used to determine if the current time is during daylight savings time or not.
This allows the "outdated" checks to be more accurate.
"""
print(repr(today))
today = today.astimezone(tz.gettz("America/Los_Angeles"))
print(repr(today))
yesterday_offset = (today - datetime.timedelta(days=1)).utcoffset()

today_offset = today.utcoffset()

print(today_offset)
print(yesterday_offset)

difference = datetime.timedelta(0)
if yesterday_offset is not None and today_offset is not None:
if yesterday_offset < today_offset:
difference = datetime.timedelta(hours=1)
if yesterday_offset > today_offset:
difference = datetime.timedelta(hours=-1)

print(difference)

return difference

0 comments on commit f54d96e

Please sign in to comment.