chenjunkai 5 年之前
父節點
當前提交
d580e90480
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      Service/CommonService.py

+ 9 - 2
Service/CommonService.py

@@ -197,8 +197,15 @@ class CommonService:
     # 获取当前时间
     @staticmethod
     def get_now_time_str(n_time, tz, lang):
-        n_time = int(n_time) + 3600 * float(tz)
+        print(n_time)
+        print(tz)
+        print(lang)
+        try:
+            tzf = float(tz)
+        except Exception:
+            tzf = 0
+        n_time = int(n_time) + 3600 * tzf
         if lang == 'cn':
             return time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(int(n_time)))
         else:
-            return time.strftime('%m-%d-%Y %H:%M:%S', time.gmtime(int(n_time)))
+            return time.strftime('%m-%d-%Y %H:%M:%S', time.gmtime(int(n_time)))