How to check if one DateTime is later than another in javascript

Asuming you received a date in Javascript Date format you need Date.parse() function or compare by comparison operators. It will return the milliseconds that have passed since 01/01/1970 00:00

Somehow like this:

if(Date.parse(datetimeStart) < Date.parse(datetimeEnd)){
   //start is less than End
}else{
   //end is less than start
}

Here is a Fiddle

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)