Please let me explain my question with real data:
Time 1: 01:26:37
Time 2: 03:42:12
How can I add and subtract the two above?
The answer to your question may be a bit complex.
I have two links that help to explain the process of adding and subtracting time and well worth the read.
What is really interesting is that the "time()" function returns a value in seconds which began in 1970 and is called "Unix Epoch"
Seconds can easily be added and subtracted using multiples of seconds, minutes, hours and days in seconds.
The "date()" function can manipulate the time return to a readable format.
If the values are coming from a database query, you could use the DBMS's date/time arithmetic functions in the query, e.g. the SUBTIME() function in MySQL.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)