Add explicit timezone when calculating isdst
This commit is contained in:
parent
807b24f897
commit
6e4107eac6
1 changed files with 2 additions and 2 deletions
|
|
@ -86,8 +86,8 @@ def isls(t: DateOrDatetime) -> bool:
|
|||
|
||||
|
||||
def isdst(t: datetime.date, tz: datetime.tzinfo = Mountain) -> bool:
|
||||
"""Return true if daylight saving time is active at the given moment"""
|
||||
t = datetime.datetime(t.year, t.month, t.day)
|
||||
"""Return true if daylight saving time is active at the start of the given UTC day"""
|
||||
t = datetime.datetime(t.year, t.month, t.day, tzinfo=datetime.timezone.utc)
|
||||
return bool(t.astimezone(tz).dst())
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue