Number to time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field called seconds formatted as number long integer. I want to
convert this to hh:nn:ss only. I don't want to convert this to an AM/PM time
as I want to show total hours, min, seconds training for the year. Also, can
this be done so it any of the figures show only one digit (i.e. minutes were
4) that it displays as 04. I would like the end result to show like this

130:04:08

Thank you.
 
One approach would be to "do the math". Hours are the result of an integer
divide ("\") by the number of seconds in an hour (3600). The remainder,
integer divided by the number of seconds in a minute (60) will give you the
minutes. The remainder of THIS, is the seconds.

You can use Format() and concatenating to come up with "hh:mm:ss" as a
display format. Note, however, that this will be a text display, not a
number.
 
Back
Top