获得的是当前时间距离1970年1月1日 00时00分00秒的毫秒数
1.
valueOf()
<script>
// 1.valueOf()
var date = new Date();
console.log(date.valueOf());
</script>
2.
getTime()
<script>
// 2.getTime()
var date = new Date();
console.log(date.getTime());
</script>
3.[实际开发常用]
+new Date()
<script>
// 3.+new Date()
var date1 = + new Date();
console.log(date1);
</script>
4.H5新增(ie9以上支持)
Date.now()
<script>
// 4.Date.now()
console.log(Date.now());
</script>