js 时间格式转换 js时间转换的方法很多,文章不定时一点点补充! 取当前时间戳对象,通过formatDate(“Y-m-d”),转成2020-7-24: var date=new Date(); var time=date.formatDate(“Y-m-d”);