var input = "2009-07-15 00:00:00 - 2009-07-15 08:16:23";
input = input.split(" - ").map(function (date){
return Date.parse(date+"-0500")/1000;
}).join(" - ");
Demo
Date.parse
docs
Note: This won't work on old browsers since I'm using Array.map
, but I think you should easily be able to shim it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…