js返回格式化的日期(年-月-日)时间:2023-03-09 06:51:22 var d = new Date(); var str = d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate(); alert(str)