소스 검색

n_time float

chenjunkai 6 년 전
부모
커밋
f59caa169b
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      Service/CommonService.py

+ 2 - 1
Service/CommonService.py

@@ -197,6 +197,7 @@ class CommonService:
     # 获取当前时间
     @staticmethod
     def get_now_time_str(n_time, tz):
-        n_time = n_time + 3600 * float(tz)
+        if tz:
+            n_time = n_time + 3600 * float(tz)
         n_date = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(int(n_time)))
         return n_date