Mozilla browser I have tried get my time-stamp in JavaScript like strtotime
in php
My Code:
//var start_date = data.result[0].start_date;
var start_date = "2011-01-26 13:51:50";
var d = Date.parse(start_date) / 1000;
console.log(d);
// 1296030110
Above code is working fine in chrome. But not working in the Mozilla Browser. I am getting NaN
value. Please help me.
After search in google I find one solution to add T
between the date and time. so I have added. I am getting the output but the output is not the same in both browser.
var start_date = "2011-01-26T13:51:50";
var d = Date.parse(start_date) / 1000;
console.log(d);
//Mozilla = 1296030110
//Chrome = 1296044910