日期:2014-05-18  浏览次数:20726 次

关于调用服务器时间
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是本地执行的
当然要调用本地时间
------解决方案--------------------
关注下