当前位置: 代码迷 >> Java Web开发 >> 关于调用服务器时间解决方案
  详细解决方案

关于调用服务器时间解决方案

热度:44   发布时间:2016-04-17 12:51:51.0
关于调用服务器时间
function   comt()   {
var   now   =   new   Date();
var   year   =   now.getYear();
var   month   =   now.getMonth()   +   1;
var   date   =   now.getDate();
var   hours   =   now.getHours();
var   mins   =   now.getMinutes();
var   secs   =   now.getSeconds();
var   timeVal   =   " ";
timeVal   +=     year   +   "- "   +     month   +   "- "   +   date+ "   "+hours;
timeVal   +=   ((mins   <   10)   ?   ":0 "   :   ": ")   +   mins;
timeVal   +=   ((secs   <   10)   ?   ":0 "   :   ": ")   +   secs;
document.form1.completed_time.value   =   timeVal;
}

为什么我这样它调用的是本地时间呢~~我需要它调用服务器时间啊

------解决方案--------------------
javascript是本地执行的
当然要调用本地时间
------解决方案--------------------
关注下
  相关解决方案