chenjunkai пре 5 година
родитељ
комит
884880668f
2 измењених фајлова са 3 додато и 7 уклоњено
  1. 1 1
      Controller/DetectController.py
  2. 2 6
      Service/CommonService.py

+ 1 - 1
Controller/DetectController.py

@@ -214,7 +214,7 @@ class NotificationView(View):
         return False
 
     def get_msg_text(self, channel, n_time, lang, tz, event_type, is_sys=0):
-        n_date = CommonService.get_now_time_str(n_time=n_time, tz=tz,lang=lang)
+        n_date = CommonService.get_now_time_str(n_time=n_time, tz=tz)
         etype = int(event_type)
         if lang == 'cn':
             if etype == 704:

+ 2 - 6
Service/CommonService.py

@@ -200,12 +200,8 @@ class CommonService:
         print(n_time)
         print(tz)
         print(lang)
-        try:
-            tzf = float(tz)
-        except Exception:
-            tzf = 0
-        n_time = int(n_time) + 3600 * tzf
+        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)))
         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)))