JavaScript中new Date()记录
- 参考网址 https://blog.csdn.net/baidu_22183129/article/details/78105964
JavaScript中new Date()只取日期不要时分秒
1
2
3
4
5
6
7
8
9
10<script>
var a = new Date();
//Thu Feb 21 2019 09:19:02 GMT+0800
var day = a.toLocaleDateString();
//2019/2/21
var b = new Date(a.toLocaleDateString())
//Thu Feb 21 2019 00:00:00
</script>时间推后10天