From 71d179de76bd3cccf853516bd7d1ad60cd25e707 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 16 Aug 2019 23:42:46 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=9C=EB=B2=84=20=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=EC=9D=84=20=EB=8D=94=20=EC=A0=95=EA=B5=90=ED=95=98=EA=B2=8C=20?= =?UTF-8?q?=EB=B0=98=EC=98=81=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/commandlist.php | 3 ++- hwe/index.php | 1 - hwe/js/main.js | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/hwe/commandlist.php b/hwe/commandlist.php index ee586cd7..e011a574 100644 --- a/hwe/commandlist.php +++ b/hwe/commandlist.php @@ -20,6 +20,7 @@ function myCommandList() { $userID = Session::getUserID(); $date = date('Y-m-d H:i:s'); + $date_precise = (new \DateTime())->format("Y-m-d H:i:s.u"); // 명령 목록 $admin = $gameStor->getValues(['year','month','turnterm','turntime','opentime']); @@ -33,7 +34,7 @@ function myCommandList() { echo " - + "; $year = $admin['year']; diff --git a/hwe/index.php b/hwe/index.php index 42dc6d06..deab7481 100644 --- a/hwe/index.php +++ b/hwe/index.php @@ -91,7 +91,6 @@ $serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games'); - diff --git a/hwe/js/main.js b/hwe/js/main.js index c67f217c..bb92e7b3 100644 --- a/hwe/js/main.js +++ b/hwe/js/main.js @@ -66,11 +66,21 @@ function reloadCommandList(){ function myclock() { - $('#clock').val(moment().tz('Asia/Seoul').format('YYYY-MM-DD HH:mm:ss')); + var $clock = $('#clock'); + var now_clock = moment(); + + if(!$clock.attr('data-time-diff')){ + var base_clock = moment($clock.attr('data-server-time')); + $clock.attr('data-time-diff', base_clock.diff(now_clock)); + } + + var game_clock = now_clock.add(parseInt($clock.attr('data-time-diff')), 'milliseconds'); + + $('#clock').val(game_clock.format('YYYY-MM-DD HH:mm:ss')); window.setTimeout(function(){ myclock(); - }, 1000); + }, 500); } jQuery(function($){
- 명령 목록 - - 명령 목록 -