Skip to content

Commit

Permalink
fix _get_datetime_now to use UTC offset for current (non-)DST
Browse files Browse the repository at this point in the history
  • Loading branch information
HarHarLinks committed Feb 16, 2024
1 parent cddd500 commit 6dec4d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion matrix_reminder_bot/bot_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
def _get_datetime_now(tz: str) -> datetime:
"""Returns a timezone-aware datetime object of the current time"""
# Get a datetime with no timezone information
no_timezone_datetime = datetime(2009, 9, 1)
no_timezone_datetime = datetime.now()

# Create a datetime.timezone object with the correct offset from UTC
offset = timezone(pytz.timezone(tz).utcoffset(no_timezone_datetime))
Expand Down

0 comments on commit 6dec4d6

Please sign in to comment.