var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.3.0");
xmlhttp.open("GET", "http://bjtime.cn", false);
xmlhttp.setRequestHeader("If-Modified-Since", "bjtime");
xmlhttp.send();
var dateStr = xmlhttp.getResponseHeader("Date");
var date = new Date(dateStr);
var year = date.getFullYear();
var month = date.getMonth() + 1;
var date1 = date.getDate();
var hour = date.getHours();
var minutes = date.getMinutes();
var second = date.getSeconds();
alert(date + " | " + year + "nian" + month + "yue" + date1 + "ri" + hour + "shi" + minutes + "fen" + second + "miao");
分享到:
2012-04-25 10:12
浏览 3877
评论