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

前端 未结 7 864
隐瞒了意图╮
隐瞒了意图╮ 2020-12-06 04:57

Through the form i am getting two values like

   Start datetime = \'01/12/2013 12:00:00 AM\' and
   End datetime = \'02/12/2013 12:00:00 AM\'.
7条回答
  •  天命终不由人
    2020-12-06 05:29

    //StartDate & EndDate two dates
    
    if (StartDate < EndDate)
       // code
    
    if you just want the dates, and not the time
    
    if (StartDate.Date < EndDate.Date)
        // code
    

提交回复
热议问题