浏览代码

修复tz时区格式

lang 3 年之前
父节点
当前提交
994789c438
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Service/CommonService.py

+ 4 - 1
Service/CommonService.py

@@ -200,7 +200,10 @@ class CommonService:
         print(n_time)
         print(tz)
         print(lang)
-        tz = tz.replace(':', '.')
+        try:
+            tz = tz.replace(':', '.')
+        except:
+            tz = 0
         n_time = int(n_time) + 3600 * float(tz)
         if lang == 'cn':
             return time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(int(n_time)))