Best to convert a formatted time string to a unix timestamp, then do your math, then convert the resulting unix timestamp back to a formatted time string.
Two caveats:
1) with your data structure, the system won't know if you're talking 5th April, or 4th May.
2) Above will calculate difference in seconds only. No further formatting like HH:MM:SS will be done; that'll be up to you (search these forums, for example)
It is always best to always get in the habit of converting time text string (formatted time) to a unix timestamp (a number).
Then, format the timestamp(s) math results as needed.
It's always best in programming to separate the time functions and processing of time from the formatting of strings, because it is trivial to convert strings to timestamps and timestamps to formatted strings.
FYI, Just about every date stored in our database here at unix.com is a unix timestamp. We generally don't store formatted date strings in DB tables (unless of course the date is part of some text in a post).
Thanks for reply.
i want complete formatting in HH:MM:SS .
1st query
SID | Start Date | Start time |End Date |End time | Duration
1607 |2019-04-05|13:06:42|2019-04-05|18:08:12 |?
2327 |2019-04-05|13:57:26|2019-04-05|19:03:43 |?
2nd query if i am entering in next date then how will calculate duration for example 5th April To 6th April.
SID | Start Date | Start time |End Date |End time | Duration
1607 |2019-04-05|13:06:42|2019-04-06|18:08:12 |?
2327 |2019-04-05|13:57:26|2019-04-06|19:03:43 |?