https://segmentfault.com/a/1190000003710954?mType=Group
1.Date()与new Date()的区别
Date() :返回当前时间 "Wed Dec 13 2017 11:18:41 GMT+0800 (中国标准时间)"
new Date();格式有严格的规定的,
a.当前时间戳的毫秒,区别于unix的秒数
b.是类似YYYY/MM/DD HH:mm:SS
这种。下文以dateString
代指。
1997-07-16T19:20:30+01:00
new Date(dateString)
所支持的字符串格式需要满足RFC2822标准或者ISO 8601标准
2.js原生的时间格式化函数有Date.parse
、Date.prototype.valueOf
、Date.prototype.getTime
、Number(Date)
、+Date