0 pts.
 determine time of day from elapsed time
does anyone know of a routine that would allow me to determine the time of day based on a beginning time and a elapsed time in hh:mm:ss?

Software/Hardware used:
ASKED: January 18, 2005  2:30 PM
UPDATED: January 18, 2005  3:15 PM

Answer Wiki:
Daddymax, In SQL, you can use: SELECT TIME ('12:10:10') + 3 HOURS FROM SYSIBM.SYSDUMMY1; This gives you 3 hours from 12 which is 15:10:15 (3 hours past noon). This also works, if you need to subtract minutes and seconds, also: SELECT TIME ('12:10:10') - '05:10:00' FROM sYSIBM.SYSDUMMY1 The IBM OS/390 UDB manuals (under time arithmetic) specify that you have to go through some additional steps first, due to the time variables: | | ? If SECOND(TIME2) <= SECOND(TIME1) | | then SECOND(RESULT) = SECOND(TIME1) - SECOND(TIME2). | | | | ? If SECOND(TIME2) > SECOND(TIME1) | | then SECOND(RESULT) = 60 + SECOND(TIME1) - SECOND(TIME2) | | and MINUTE(TIME2) is incremented by 1. | | ? If MINUTE(TIME2) <= MINUTE(TIME1) | | then MINUTE(RESULT) = MINUTE(TIME1) - MINUTE(TIME2). | | ? If MINUTE(TIME2) > MINUTE(TIME1) | | then MINUTE(RESULT) = 60 + MINUTE(TIME1) - MINUTE(TIME2) | | and HOUR(TIME2) is incremented by 1. | ? HOUR(RESULT) = HOUR(TIME1) - HOUR(TIME2). |
Last Wiki Answer Submitted:  January 18, 2005  3:15 pm  by  SQLLER   0 pts.
All Answer Wiki Contributors:  SQLLER   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _