Solved

Converting decimal time to standard

Posted on 2004-04-14
1
289 Views
Last Modified: 2010-05-02
how do I convert the following time which is in decimal format;

6.21207295

to

6:12:43.46


Thanks
0
Comment
Question by:lehman6676
1 Comment
 
LVL 3

Accepted Solution

by:
monkesdb earned 50 total points
ID: 10824442
lehman6676,

i assume without working it through it's

val = 6.21207295

hours = int(val)
val = val - hours
val = val * 60
mins = int(val)
val = val - mins
val = val * 60
secs = int(val)
val = val - secs
val = val * 1000
millis = int(val)

MsgBox hours & ":" & mins & ":" & secs & "." & millis

val should equal 0 by this point
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb6 programatically bring window to front 8 65
Concatenate 2 userform comboboxes to a userform text box 4 56
VBA saving file message display 5 56
Spell Check in VB6 13 99
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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now