difference between two time - Forum

Forum Navigation
You need to log in to create posts and topics.

difference between two time

Is there anyway to find difference between two time in easy way?

Uploaded files:
  • You need to login to have access to uploads.

@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