# Subtracting Waiting Time from Current Time (24-Hour Notation)

Printable View

• 05-08-2007
impact
Subtracting Waiting Time from Current Time (24-Hour Notation)
Okay, so I have created a program that allows a user to convert 24-hour notation to 12-hour notation. Ex// it converts 14:25 to 2:25 PM. Though now I'm having trouble subtracting a waiting period from the current time, and then output what the time will be after the waiting period.

If you need the conversion code from 24hrN to 12hrN let me know.
• 05-08-2007
impact
I know that the waiting time, and the current time need to be two seperate intergers. I just need some kind of idea on how to start this off. Thanks again for all your help.
• 05-08-2007
Salem
If you can convert between minutes and hr:mm, then it's easy.
• 05-10-2007
impact
still having a bit problem with this one.. maybe im overthinking it ??
• 05-10-2007
Salem
When you read a time, convert it to minutes (hh*60+mm)

When you output a time, convert it to hh:mm

Any calculations in the meantime are done just on minutes.
• 11-21-2009
lia said
can you show me the coding?
• 11-21-2009
lia said
Quote:

Originally Posted by impact
Okay, so I have created a program that allows a user to convert 24-hour notation to 12-hour notation. Ex// it converts 14:25 to 2:25 PM. Though now I'm having trouble subtracting a waiting period from the current time, and then output what the time will be after the waiting period.

If you need the conversion code from 24hrN to 12hrN let me know.

help needed please...
• 11-21-2009
rodrigorules
store time as h:m:s
store waiting time as h:m:s

create method to change h:m:s -> s
create method to change s ->h:m:s

use methods to do the following:
change currentTime -> s
change waitingTime ->s

(currentTime + waiting time)s -> h:m:s

.