Stefan Schmidt 5 years ago
parent
commit
e24e7f010a
1 changed files with 1 additions and 3 deletions
  1. 1 3
      code/ID2TLib/Utility.py

+ 1 - 3
code/ID2TLib/Utility.py

@@ -190,9 +190,7 @@ def get_filetime_format(timestamp):
     :param timestamp: a timestamp in seconds
     :return: MS FILETIME timestamp
     """
-    boot_datetime = dt.datetime.fromtimestamp(timestamp)
-    if boot_datetime.tzinfo is None or boot_datetime.tzinfo.utcoffset(boot_datetime) is None:
-        boot_datetime = boot_datetime.replace(tzinfo=boot_datetime.tzname())
+    boot_datetime = pytz.timezone('UTC').localize(dt.datetime.fromtimestamp(timestamp))
     boot_filetime = 116444736000000000 + (cal.timegm(boot_datetime.timetuple()) * 10000000)
     return boot_filetime + (boot_datetime.microsecond * 10)