Sfoglia il codice sorgente

修复tz时区格式

lang 3 anni fa
parent
commit
994789c438
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  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)))