获取yyyy-mm-dd hh:ii:ss形式的日期时间

function getFormatDate(){
  
//将日期转换为本地格式。
  var strDate=new Date().toLocaleString();
  
//将字符串形式的日期进行格式化。
  return strDate.replace(/[年]|[月]/g,"-").replace(/[日]/g,"");
}

 

 

相关文章:

  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-02-10
相关资源
相似解决方案