瀏覽代碼

增加equipment timezon

chenjunkai 6 年之前
父節點
當前提交
d81167395f
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      Controller/EquipmentStatus.py

+ 8 - 0
Controller/EquipmentStatus.py

@@ -110,6 +110,14 @@ def getTZ(request):
         if len(uid) == 20:
             print(uid)
             info = CommonService.getIpIpInfo(ip=ip, lang=lang)
+            tz = info['utc_offset']
+            if ':' not in info['utc_offset']:
+                info['utc_offset'] = info['utc_offset'] + ':00'
+            gmtz = tz.replace('UTC','GMT')
+            if ':' not in gmtz:
+                gmtz = gmtz+':00'
+            info['gmt_offset'] = gmtz
+
             # tz = info.timezone
             # of = info.utc_offset
             # from var_dump import var_dump