var date = ‘2015-03-05 17:59:00’;
date = date.substring(0,19);
date = date.replace(/-/g,’/’);
var timestamp = new Date(date).getTime();
document.write(timestamp);// 根据毫秒数构建 Date 对象
var date = new Date(timestamp);
// 格式化日期
dateTime = date.toLocaleString();
alert(dateTime);