From a92374167549afc62952e6e8c7f928dce85bfc6f Mon Sep 17 00:00:00 2001
From: Jeremy M Fee <jmfee@usgs.gov>
Date: Wed, 7 Oct 2020 19:33:53 +0000
Subject: [PATCH] Use UTCDateTime.replace method for rounded_usecs.

instead of deprecated microsecond property setter.
---
 geomagio/TimeseriesUtility.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/geomagio/TimeseriesUtility.py b/geomagio/TimeseriesUtility.py
index adecbcb0..418bbe9c 100644
--- a/geomagio/TimeseriesUtility.py
+++ b/geomagio/TimeseriesUtility.py
@@ -557,5 +557,6 @@ def round_usecs(time):
     if rounded_usecs > 999000:
         rounded_usecs = 0
         time += 1
-    time.microsecond = rounded_usecs
+    if rounded_usecs != usecs:
+        time = time.replace(microsecond=rounded_usecs)
     return time
-- 
GitLab