只做记录 function init_date() { let now = new Date(); let year = now.getFullYear(); let month = now.getMonth() + 1; let day = now.getDate(); let clock = year + '-'; if (month < 10) { clock += '0'; } clock += month + '-'; if (day < 10) { clock += '0'; } clock += day; console.log(clock)
01-19
10-30
3198
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交