time calculations

  • Thread starter Thread starter iccsi
  • Start date Start date
I

iccsi

I have a field which has data in seconds.

I would like to show user hh:mm:ss for display format.

Are there any functions to conver seconds to hh:mm:ss to end users or
I have code to calculate by myself?

Your information is great appreciated,
 
iccsi said:
I have a field which has data in seconds.

I would like to show user hh:mm:ss for display format.

Are there any functions to conver seconds to hh:mm:ss to end users or
I have code to calculate by myself?


Calculate it yourself:

If you can guarantee that your seconds value will always be
less than 24 hours, then you can get away with using:
Format(secs / (24*60*60#), "h:nn:ss")

Otherwise this will do it:
=secs \ 3600 & Format((secs \ 60) Mod 60, "\:00") &
Format(secs Mod 60, "\:00")
 
Calculate it yourself:

If you can guarantee that your seconds value will always be
less than 24 hours, then you can get away with using:
        Format(secs / (24*60*60#), "h:nn:ss")

Otherwise this will do it:
        =secs \ 3600 & Format((secs \ 60) Mod 60, "\:00") &
Format(secs Mod 60, "\:00")

Thanks millions,
 
Back
Top