function getServerDate() {
return new Date($.ajax({
async : false
}).getResponseHeader("Date"));
}
function getNowDate() {
var xhr = null;
if (window.XMLHttpRequest) {
xhr = new window.XMLHttpRequest();
} else {
xhr = new ActiveObject("Microsoft")
}
xhr.open("GET", "/", false)
xhr.send(null);
var date = xhr.getResponseHeader("Date");
var date = new Date(date);
return date;
}这两个方法 我都用了 都不准确