javascript - Comparing date time using javasctipt -
i trying compare 2 dates using javascript,the datetime format given below.here want check date1 > date2.how can achive in javascript.
var date1='2014-03-25 07:30 am'; var date2='2014-03-25 04:30 pm';
use gettime:
if ((new date(date1).gettime()) > ( new date(date2).gettime())){ }
Comments
Post a Comment