Skip to content

Commit

Permalink
修正非+8时区的时间同步问题
Browse files Browse the repository at this point in the history
  • Loading branch information
showpy committed Jun 22, 2019
1 parent 5ab65dc commit b64c7bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion class/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def init(self):
if ua:
ua = ua.lower();
if ua.find('spider') != -1 or ua.find('bot') != -1: return redirect('https://www.baidu.com');
g.version = '6.9.5'
g.version = '6.9.23'
g.title = public.GetConfigValue('title')
g.uri = request.path
session['version'] = g.version;
Expand Down
7 changes: 5 additions & 2 deletions class/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,11 @@ def setFpmConfig(self,get):

#同步时间
def syncDate(self,get):
dateStr = public.HttpGet(public.GetConfigValue('home') + '/api/index/get_date')
result = public.ExecShell('date -s "%s"' % dateStr);
time_str = public.HttpGet(public.GetConfigValue('home') + '/api/index/get_time')
new_time = int(time_str)
time_arr = time.localtime(new_time)
date_str = time.strftime("%Y-%m-%d %H:%M:%S", time_arr)
result = public.ExecShell('date -s "%s"' % date_str);
public.WriteLog("TYPE_PANEL", "DATE_SUCCESS");
return public.returnMsg(True,"DATE_SUCCESS");

Expand Down

0 comments on commit b64c7bd

Please sign in to comment.