Aug 17, 2001 #1 SDS100UK MIS Jul 15, 2001 185 GB Hi, Does anyone know the formula that converts decimal time into true time? i.e. 2.5 hrs (dec) = 2:30 (true time) I would appreciate your help with this , otherwise I will have to struggle to write it myself. Thanks in advance Steven
Hi, Does anyone know the formula that converts decimal time into true time? i.e. 2.5 hrs (dec) = 2:30 (true time) I would appreciate your help with this , otherwise I will have to struggle to write it myself. Thanks in advance Steven
Aug 17, 2001 #2 VogonPoet Programmer Apr 9, 2001 116 US Assuming the output can be a string, you could use the following function: Public Function TrueTime(DecTime As Double) As String Dim intTime As Integer Dim dblMinutes As Double intTime = Int(DecTime) dblMinutes = DecTime - intTime TrueTime = Format$(intTime, "0" & ":" & Format$(dblMinutes * 60, "00" End Function Upvote 0 Downvote
Assuming the output can be a string, you could use the following function: Public Function TrueTime(DecTime As Double) As String Dim intTime As Integer Dim dblMinutes As Double intTime = Int(DecTime) dblMinutes = DecTime - intTime TrueTime = Format$(intTime, "0" & ":" & Format$(dblMinutes * 60, "00" End Function
Aug 18, 2001 #3 MichaelRed Programmer Dec 22, 1999 8,410 US ? format(2.5/24, "Short Time" 02:30 Hint the hint is in the denominator! Another Hint. DO NOT try this at home with Numerator > Denominator. MichaelRed mred@att.net There is never time to do it right but there is always time to do it over Upvote 0 Downvote
? format(2.5/24, "Short Time" 02:30 Hint the hint is in the denominator! Another Hint. DO NOT try this at home with Numerator > Denominator. MichaelRed mred@att.net There is never time to do it right but there is always time to do it over