M
marty
As part of an assignment I need to calculate a 24 hour time by subtracting a
one time from another e.g. if the user enters 1.00 as the time and 1.30 as
the time to subtract the returned time is 23.30 the previous day.
This is straightforward when dealing with positive times. But when negative
times are introduced (as above) it all gets tricky.
I'd originally thought that a lookup table of times against a corresponding
negative time might be useful. But this wouldn't be flexible enough to
handle anything later than 24 hours.
Is there a mathematical way to calculate this? I don't want the code written
for me, just a few ideas.
TIA
one time from another e.g. if the user enters 1.00 as the time and 1.30 as
the time to subtract the returned time is 23.30 the previous day.
This is straightforward when dealing with positive times. But when negative
times are introduced (as above) it all gets tricky.
I'd originally thought that a lookup table of times against a corresponding
negative time might be useful. But this wouldn't be flexible enough to
handle anything later than 24 hours.
Is there a mathematical way to calculate this? I don't want the code written
for me, just a few ideas.
TIA