Convert decimal to time

  • Thread starter Thread starter Norman Belanger
  • Start date Start date
N

Norman Belanger

Hi,

Is there an function that converts decimal values to time. For instance,
3.75 hours to 3:45

Thanks

Norm
 
Try this:

Public Function ConvertTimeFractionToHM(dblTimeFraction As Double) As String
Dim intHour As Integer
intHour = Int(dblTimeFraction)
ConvertTimeFractionToHM = CStr(intHour) & ":" & Format((dblTimeFunction -
intHour) * 60, "00")
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top