<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'>
<title>time</title>
</head>
<script>
var date=new Date();
//alert(date.getFullYear());//获取年
//alert(date.getMonth()+1);//获取月份,从0开始
//alert(date.getDate());//获取日期
alert(date.getDay());//获取星期几,从0到6
</script>
<body>
</body>
</html>
深入JS2.1获取时间
最新推荐文章于 2024-04-24 06:14:50 发布