Scroll

Convert Hours (decimal) to HH:MM format

Convert Hours (decimal) to HH:MM format

Follow
Summary

The article features an example of using Askiascript to convert hours (in decimals) to HH:MM

Applies to askiadesign
Written for Scripters and Data Processors 
Keywords

script; askiascript; time; hour; format;

 

It is possible to take a decimal integer and convert it to a standard HH:MM time format utilizing AskiaScript. 

 

Below, an example excerpt:

 

Dim D
Dim e

D = q1.Value

e = "" + ((D - Int(D)) / 100 * 60).Round(2) + "0"
Return "" + Int(D) + ":" + Mid(e, 3, 2)



For instance, if a value of 1.25 was imported the value returned would be 1:15 for 1 hour and 15 minutes.

An example QEX file is also included to this article.

 

 

 

Have more questions? Submit a request

Comments