<script>
function TZDemo(){
var d, tz, s = " The current local time is ";
d = new Date();
tz = d.getTimezoneOffset();
if (tz < 0)
s += tz / 60 + " hours before GMT";
else if (tz == 0)
s += "GMT";
else
s += tz / 60 + " hours after GMT";
return(s);
}
function DateDemo(){
var d, s = "今天日期是: ";
d = new Date();
s += (d.getMonth() + 1) + "/";
s += d.getDate() + "/";
s += d.getYear();
return(s);
}
alert(DateDemo());
</script>
评论1
最新资源