Solved

Converting decimal time to standard

Posted on 2004-04-14
1
288 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now