Date()日期对象 是一个构造函数 必须使用new来调用创建我们的日期对象
- 如果里面没有参数 返回当前系统的当前时间
- 参数常用的写法 数字型 2019,10,01 或者是字符串型’2019-10-1 8:8:8’
getmonth :记得月份加1哦
getfullyear
getdate 返回今天几号
Getday 返回今天周几 周一至周六返回1~6 周日为0
getHours 返回小时数
getMinutes 返回分钟
getSeconds 返回秒数
时间戳:通过valueOf() getTime(); date = + new Date;
Date.now();
案例
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>倒计时</title>
<style>
.box{
width: 400px;
height