From 0306452d21e8552c95cae3bf73cb58244451a4a6 Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Wed, 13 Nov 2024 06:59:54 -0700 Subject: [PATCH] MNT: Replace deprecated utcnow() call --- lib/cartopy/feature/nightshade.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cartopy/feature/nightshade.py b/lib/cartopy/feature/nightshade.py index 5a0fa310a..49c3c44f0 100644 --- a/lib/cartopy/feature/nightshade.py +++ b/lib/cartopy/feature/nightshade.py @@ -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``). @@ -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():