Dooie
Dooie

Reputation: 1669

Javascript Compare Date and Time

I have two date time strings formated like so; 29/09/2009 15:19 & 29/09/2009 17:19 and basiclly all i want to do is compare the two date and time to see which is greater

Any Help?

Upvotes: 8

Views: 11712

Answers (1)

Jan Hančič
Jan Hančič

Reputation: 53930

if ( Date.parse ( firstDateString ) > Date.parse ( secondDateString ) ) {
    // first date is greater
}

Upvotes: 10

Related Questions