Skip to content

Commit

Permalink
avoid deprecated utcnow
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed May 19, 2024
1 parent 976e0b0 commit 4f95df4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion leapseconddata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class LeapSecondData:

def _check_validity(self, when: Optional[datetime.datetime]) -> Optional[str]:
if when is None:
when = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc)
when = datetime.datetime.now(datetime.timezone.utc)
if not self.valid_until:
return "Data validity unknown"
if when > self.valid_until:
Expand Down

0 comments on commit 4f95df4

Please sign in to comment.