Converting an Integer to a Time

I have a time in minutes as an Integer and want to covert it into a time that will display to a grid hours and minutes.
Example:

Input :      Time in minutes = 745
Output: Time in hours and minutes = 12:25

I also want to compare this time with the current time now and if the time now is greater that the time listed then I want to set a Boolean flag as true.

Thank you for your help and I look forward to your reply
Richard
StokeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
caraf_gConnect With a Mentor Commented:
'Q1:
Dim t As Integer
t = 745

Dim dblD As Double
dblD = t
dblD = t / 60 / 24

Dim datD As Date
datD = dblD
MsgBox Format(datD, "hh:nn")

'Q2:

Dim datB As Date
datB = Now
datB = datB - Int(datB)

If datB > datD Then
    'It's after 12:25
End If

0
 
StokeAuthor Commented:
Very Well Done.  Exactly what I needed.
Thank you Caraf_g
0
All Courses

From novice to tech pro — start learning today.