Skip to content

Commit

Permalink
Merge pull request #2478 from greglucas/utcnow-change
Browse files Browse the repository at this point in the history
MNT: Replace deprecated utcnow() call
  • Loading branch information
rcomer authored Nov 13, 2024
2 parents ff742b0 + 0306452 commit 0d4e39f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cartopy/feature/nightshade.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, date=None, delta=0.1, refraction=-0.83,
----------
date : datetime
A UTC datetime object used to calculate the position of the sun.
Default: datetime.datetime.utcnow()
Default: The current UTC time.
delta : float
Stepsize in degrees to determine the resolution of the
night polygon feature (``npts = 180 / delta``).
Expand All @@ -38,7 +38,7 @@ def __init__(self, date=None, delta=0.1, refraction=-0.83,
"""
if date is None:
date = datetime.datetime.utcnow()
date = datetime.datetime.now(datetime.UTC)

# make sure date is UTC, or naive with respect to time zones
if date.utcoffset():
Expand Down

0 comments on commit 0d4e39f

Please sign in to comment.