This commit is contained in:
2023-05-01 19:37:40 +08:00
commit da2c0fadf7
133 changed files with 29002 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
//00-创建当前日期
let newDate =new Date();
console.log(newDate);
//01-创建一个自定义日期
let customDate = new Date("2022-02-01 00:00:00");
console.log( customDate);
//02-获取日期对象中的属性
console.log( newDate.getFullYear()); //年
console.log( newDate.getMonth()+1); //月 月份从0开始的
console.log( newDate.getDate()); //日
console.log( newDate.getHours()); //时
console.log( newDate.getMinutes()); //分
console.log( newDate.getSeconds()); //秒
console.log( newDate.getMilliseconds());//毫秒
//特殊
//星期
console.log(newDate.getDay()); // 0星期天
console.log(newDate.getTime()); //时间戳 以毫秒为单位
</script>
</body>
</html>