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($){
- 명령 목록 - - 명령 목록 -