From c3aa2aeae43992973d3078afcea6e3a34ec97d57 Mon Sep 17 00:00:00 2001 From: Zach Sherman Date: Thu, 11 Apr 2024 15:36:34 -0500 Subject: [PATCH] FIX: Updates datetime.utcnow to .now using timezone object. (#1556) --- pyart/io/mdv_grid.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyart/io/mdv_grid.py b/pyart/io/mdv_grid.py index c154512af9..0c0ad54c70 100644 --- a/pyart/io/mdv_grid.py +++ b/pyart/io/mdv_grid.py @@ -109,7 +109,9 @@ def write_grid_mdv(filename, grid, mdv_field_names=None, field_write_order=None) d["max_nx"] = nx d["max_ny"] = ny d["max_nz"] = nz - td = datetime.datetime.utcnow() - datetime.datetime(1970, 1, 1, 0, 0) + td = datetime.datetime.now(datetime.timezone.utc) - datetime.datetime( + 1970, 1, 1, 0, 0 + ) d["time_written"] = int( round(td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 )