Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Converting an Integer to a Time

Posted on 1999-07-22
2
Medium Priority
?
134 Views
Last Modified: 2010-04-30
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
0
Comment
Question by:Stoke
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
caraf_g earned 400 total points
ID: 1526602
'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
 

Author Comment

by:Stoke
ID: 1526603
Very Well Done.  Exactly what I needed.
Thank you Caraf_g
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question