js 时间日期转换时间戳格式
function get_unix_time(dateStr) { // dateStr="2019-09-06 21:49:30"; var newstr = dateStr.replace(/-/g,'/'); var date = new Date(newstr); var time_str = date.getTime().toString(); return time_str.substr(0, 10); // alert(time_str.substr(0, 10)); }