summaryrefslogtreecommitdiffstats
path: root/gallery_dl/text.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2020-06-29 00:33:22 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2020-06-29 00:33:22 -0400
commit02dd2886783cd303cff6890a741152d013bb00ce (patch)
treee5d4a805888147de8efe514a3c55e303230a508b /gallery_dl/text.py
parent8c911e3d62a430f5630c13d51b47201fa8ff3cd1 (diff)
New upstream version 1.14.2.upstream/1.14.2
Diffstat (limited to 'gallery_dl/text.py')
-rw-r--r--gallery_dl/text.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/gallery_dl/text.py b/gallery_dl/text.py
index 4dc0963..9a716f9 100644
--- a/gallery_dl/text.py
+++ b/gallery_dl/text.py
@@ -252,10 +252,13 @@ def parse_datetime(date_string, format="%Y-%m-%dT%H:%M:%S%z", utcoffset=0):
o = d.utcoffset()
if o is not None:
# convert to naive UTC
- d = d.replace(tzinfo=None) - o
- elif utcoffset:
- # apply manual UTC offset
- d += datetime.timedelta(0, utcoffset * -3600)
+ d = d.replace(tzinfo=None, microsecond=0) - o
+ else:
+ if d.microsecond:
+ d = d.replace(microsecond=0)
+ if utcoffset:
+ # apply manual UTC offset
+ d += datetime.timedelta(0, utcoffset * -3600)
return d
except (TypeError, IndexError, KeyError):
return None