KB-32021: Converting seconds into Time format.

Question:

How can I convert a counter’s value from seconds to hours, minutes, and seconds (for example, from 70 seconds to 00h 01min 10seg)?

Solution:

A possible solution is by using this script:

dim H, M, S  // String Variables
dim ZH, ZM, ZS  // Integer
Variables
dim Sec, Result
Sec = TagContSeg

ZH = Int(Sec / 3600)
ZM = Int(Sec / 60) – ZH * 60
ZS = Sec – (ZH * 3600 + ZM * 60)
H = Str(ZH)
M = Str(ZM)
S = Str(ZS)

Result = H + ‘:’ + M + ‘:’ + S
MessageBox(Result)

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *