Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting SECONDS to Hours:Minutes:Seconds 1

Status
Not open for further replies.

LeonelSanchezJr

Programmer
Jan 26, 2001
522
US
I have an field which holds the average amount of seconds that a process took.

How do I convert this field into HOURS, MINUTES and SECONDS?

Example:


Seconds = 95

Converted to HH:MM:SS would be: 00:01:35

 
In a formula field....


NumberVar Hours := Truncate(SECONDS_FIELD / (60 * 60));
NumberVar Minutes := Truncate((SECONDS_FIELD - (60 * 60 * Hours)) / 60);
NumberVar Seconds := SECONDS_FIELD - ((60 * 60 * Hours) + (60 * Minutes));

TimeSerial(Hours,Minutes,Seconds)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top