31
QB64 Discussion / adding/subtracting times
« on: July 26, 2020, 03:53:07 pm »
Hi
Someone out there must have come across this before.
I need to subtract one time from another, to work out an elspased time.
The times are stored in the format hh:mm:ss.dd so are always the same length (time of day stored to 2 decimal places)
Anyone got some code which can do this?
I'll need to have the result stored in (a) the same format (i.e. to 2 decimal places) and also (b) as a number of seconds rounded up to the next full second (anything after the deimal point rounds up, not just to the nearest second), but I can probably figure that out once I've got the subtraction worked out.
It will save me having to write some convoluted code (as I'm not exactly smart with this stuff)
Many thanks for your time.
John
Someone out there must have come across this before.
I need to subtract one time from another, to work out an elspased time.
The times are stored in the format hh:mm:ss.dd so are always the same length (time of day stored to 2 decimal places)
Anyone got some code which can do this?
I'll need to have the result stored in (a) the same format (i.e. to 2 decimal places) and also (b) as a number of seconds rounded up to the next full second (anything after the deimal point rounds up, not just to the nearest second), but I can probably figure that out once I've got the subtraction worked out.
It will save me having to write some convoluted code (as I'm not exactly smart with this stuff)
Many thanks for your time.
John