This is my jQuery code. In this code, #StartTime and #EndTime displays the form input tag identifier.
The time format is 00:00 AM / PM.
var starttimeval and endtimeval contain values ββfor the start and end time.
How to compare these two times, for example: if(starttimeval < endtimeval){alert(message);}
$(function() { $('#StartTime').datetimepicker({ datepicker : false, format : 'g:i A' }); $('#EndTime').datetimepicker({ datepicker : false, format : 'g:i A' }); var starttimeval= $("#StartTime").val(); var endtimeval= $("#EndTime").val(); });

I only need a time comparison function. example of getting starttimeval = 8: 00 PM and endtimeval = 9: 00 AM
source share