function getdate() {
var http = new XMLHttpRequest;
http.open("HEAD", ".", false);
http.send(null);
var now = new Date(http.getResponseHeader("Date"));
y = now.getFullYear();
m = now.getMonth() + 1;
d = now.getDate();
m = m < 10 ? "0" + m : m;
d = d < 10 ? "0" + d : d;
return y + "-" + m + "-" + d;
}
转载于:https://blog.51cto.com/3876775/1070907