//getnowtime()返回'2023-07-2 21:24'//getnowtime('/')返回'2023/07/2 21:24'functiongetnowtime(symbol='-'){
let date =newDate(),month,hours,minutes;return date.getFullYear()+symbol+((month
时间格式化一、2022-05-30 10:34年份四位数,其它两位数var date = new Date(),month,hours,minutes;var strDate = date.getFullYear()+"-"+((month=date.getMonth()+1)<10?'0'+month:month)+"-"+date.getDate()+" "+((hours=date.getHours())<10?'0'+hours:hours)+":"+((minutes=date