Date()参数格式:
以2017年7月3日,18:31:37// Mon Jul 03 2017 18:31:37 GMT+0800 (CST)
为例。日期时间。时间的格式必须是hh:mm:ss;日期的格式中文英文都可以,中间有分割
-/,space.
即可。123new Date('7-3-2017 18:31:37');new Date('2017-7-3 18:31:37');// 我常用new Date('Jul 3 3017 18:31:37);年,月,日,时,分,秒
1new Date(2017,6,3,18,31,37);// 注意月份时间戳
1new Date(1499077897000);// 时间戳
常用的date方法
有get方法,就有相应的set方法123456789var date = new Date(),// 当前时间week = date.getDay(),// 星期day = date.getDate(),// 日期month = date.getMonth() + 1,// 月year = date.getFullYear();// 年hour = date.getHours();// 小时minute = date.getMinutes();// 分second = date.getSeconds();// 秒time = date.getTime();// 时间戳