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.
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.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks