I have two times formatted as strings in my database, they are in the format 8:30AM and 9:00 PM respectively. Using Javascript, I wan’t to get the current time and see if I am within the rang of the two times. How would I go about doing this
Share
Convert the start, end and current time into JavaScript Date objects, then check if
start <= current < end. It gets tricky if the start date becomes less than end date: