Skip to content

Commit

Permalink
MNT: Replace deprecated utcnow() call
Browse files Browse the repository at this point in the history
  • Loading branch information
greglucas committed Nov 13, 2024
1 parent def171d commit 0306452
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 0306452

Please sign in to comment.