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

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

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

 

 

posted on 2010-12-16 17:57  Leon_He  阅读(1416)  评论(0编辑  收藏  举报

导航