Back
I want to convert the date to timestamp. Can anyone tell me how to do this?
You can do it like this:
var myDate = "26-02-2012";myDate = myDate.split("-");var newDate = new Date( myDate[2], myDate[1] - 1, myDate[0]);console.log(newDate.getTime());
var myDate = "26-02-2012";
myDate = myDate.split("-");
var newDate = new Date( myDate[2], myDate[1] - 1, myDate[0]);
console.log(newDate.getTime());
Want to learn Full Stack Development? Check out the Full Stack Development course from Intellipaat.
31k questions
32.8k answers
501 comments
693 users