How do I convert this into timestamp
Datetime = 2014-07-14T09:34:47.000Z
Timestamp = ?
How do I convert this into timestamp
Datetime = 2014-07-14T09:34:47.000Z
Timestamp = ?
var Datetime = "2014-07-14T09:34:47.000Z";
new Date(Datetime).getTime();
This will return the number of milliseconds since the epoch.
Try this:
function getTimeStamp(dateStr) { //example: "2014-07-14T09:34:47"
var s = new Date(dateStr);
return s.getFullYear()*10000000000 + (s.getMonth()+1)*100000000 + s.getDate()*1000000 + s.getHours()*10000 + s.getMinutes()*100 + s.getSeconds();
}
Note that you have to remove the milliseconds from your example.