Skip to content

Commit

Permalink
fix getUtcOffsetByEpoch and getUtcOffsetByGDate returning float
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Dec 22, 2024
1 parent d141945 commit 507e25e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scal3/time_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def getUtcOffsetByEpoch(epoch: int, tz: TZ = None) -> int:
except ValueError as e:
log.error(f"{epoch=}, error: {e}")
return 0
return tz.utcoffset(dt).total_seconds()
return int(tz.utcoffset(dt).total_seconds())


def getUtcOffsetByGDate(year: int, month: int, day: int, tz: TZ = None) -> int:
Expand All @@ -121,7 +121,7 @@ def getUtcOffsetByGDate(year: int, month: int, day: int, tz: TZ = None) -> int:
except ValueError as e:
log.error(f"getUtcOffsetByGDate: {year=}, error: {e}")
return 0
return tz.utcoffset(dt).total_seconds()
return int(tz.utcoffset(dt).total_seconds())


def getUtcOffsetByJd(jd: int, tz: TZ = None) -> int:
Expand Down

0 comments on commit 507e25e

Please sign in to comment.