I have two dates:
D1 = 2017-05-01 00:00:00 and
D2 = Thu Jun 01 2017 16:12:08 GMT+0530 (India Standard Time) "d".
How can I compare these two dates in javascript?
if (D1>D2) { do something } else { do something}
I have two dates:
D1 = 2017-05-01 00:00:00 and
D2 = Thu Jun 01 2017 16:12:08 GMT+0530 (India Standard Time) "d".
How can I compare these two dates in javascript?
if (D1>D2) { do something } else { do something}
Why jquery? simply Do with new Date()
var D1 = '2017-05-01 00:00:00'
var D2 = 'Thu Jun 01 2017 16:12:08 GMT+0530';
console.log(new Date(D1).getTime(),new Date(D2).getTime())