一句搞定JS常见日期格式

得到的日期格式:"2019-9-19"

new Date().toLocaleDateString().replace(/ \ / /g,’-’)
posted @ 2022-06-29 22:45  ^finally  阅读(42)  评论(0)    收藏  举报