Quote from
Gaev on July 3, 2020, 3:42 pm
@asmat
1) Are you looking for a simple difference between to time strings only ? ... i.e. assume same day ?
2) Can end time be less than start time ?
Irrespective of your answers, note that Javascript offers Date() objects and methods to turn any date+time into a number (milliseconds since January 01, 1970, 00:00:00 UTC) ... this makes it very easy to accomplish what you are looking for ...
- convert start and end date+time to numbers
- subtract one number from another
- divide by 1,000 (to get seconds), 60 more (to get minutes) etc. etc.
... for more info, you can begin here ... https://www.w3schools.com/js/js_dates.asp
@asmat
1) Are you looking for a simple difference between to time strings only ? ... i.e. assume same day ?
2) Can end time be less than start time ?
Irrespective of your answers, note that Javascript offers Date() objects and methods to turn any date+time into a number (milliseconds since January 01, 1970, 00:00:00 UTC) ... this makes it very easy to accomplish what you are looking for ...
- convert start and end date+time to numbers
- subtract one number from another
- divide by 1,000 (to get seconds), 60 more (to get minutes) etc. etc.
... for more info, you can begin here ... https://www.w3schools.com/js/js_dates.asp