Converting Time from Seconds

ASherbuck

Registered User.
Local time
Today, 07:31
Joined
Feb 25, 2008
Messages
194
I've got a time clock that stores the current time in seconds in a table.

I'm having a real hard time figuring out how to convert seconds into hh:mm:ss.

For Ex.
"6" = 00:00:06
"67" = 00:01:07
etc

Any ideas? Another thread was mentioning using int() but I don't think that's what I'm looking for.
 
Hi -

Consider that there are 86400 seconds in a day (60 seconds * 60 minutes * 24 hours). So, two ways of doing depending on whether your [number of seconds] are stored as a number or a string (should really be a number, but it can be done if it's a string).

Seconds stored as a number:
x = 6
? format(x/86400, "hh:nn:ss")
00:00:06

Seconds stored as a string:
y = "67"
? format(int(y)/86400, "hh:nn:ss")
00:01:07

HTH - Bob
 
Thanks a bunch, I was using the Format but I had the "hh:mm:ss" wrong
 

Users who are viewing this thread

Back
Top Bottom