dateStr格式为“ 2014-05-08 00:22:11 ” function get_unix_time(dateStr) { var newstr = dateStr.replace(/-/g,'/'); var date = new Date(newstr); var time_str = date.getTime().toString(); return time_str.substr(0, 10); } 转载地址:http://blog.sina.com.cn/s/blog_97688f8e0101wmha.html