Ver código fonte

chore: remove windows platform timezone set (#8712)

非法操作 7 meses atrás
pai
commit
9ca2e2c968
1 arquivos alterados com 3 adições e 5 exclusões
  1. 3 5
      api/app.py

+ 3 - 5
api/app.py

@@ -53,11 +53,9 @@ from services.account_service import AccountService
 
 
 warnings.simplefilter("ignore", ResourceWarning)
 warnings.simplefilter("ignore", ResourceWarning)
 
 
-# fix windows platform
-if os.name == "nt":
-    os.system('tzutil /s "UTC"')
-else:
-    os.environ["TZ"] = "UTC"
+os.environ["TZ"] = "UTC"
+# windows platform not support tzset
+if hasattr(time, "tzset"):
     time.tzset()
     time.tzset()