mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:39:25 +08:00
Update mw.py
This commit is contained in:
+9
-9
@@ -404,15 +404,15 @@ def formatDate(fmat="%Y-%m-%d %H:%M:%S", times=None, time_zone=None):
|
|||||||
if not times:
|
if not times:
|
||||||
times = int(time.time())
|
times = int(time.time())
|
||||||
|
|
||||||
if time_zone is None:
|
# if time_zone is None:
|
||||||
try:
|
# try:
|
||||||
import tzlocal
|
# import tzlocal
|
||||||
time_zone = str(tzlocal.get_localzone())
|
# time_zone = str(tzlocal.get_localzone())
|
||||||
except:
|
# except:
|
||||||
try:
|
# try:
|
||||||
time_zone = time.tzname[0]
|
# time_zone = time.tzname[0]
|
||||||
except:
|
# except:
|
||||||
time_zone = None
|
# time_zone = None
|
||||||
|
|
||||||
if time_zone:
|
if time_zone:
|
||||||
old_tz = os.environ.get('TZ')
|
old_tz = os.environ.get('TZ')
|
||||||
|
|||||||
Reference in New Issue
Block a user