Re: Second-Time conversion
Re: Second-Time conversion
- Subject: Re: Second-Time conversion
- From: Nigel Garvey <email@hidden>
- Date: Thu, 24 Jun 2004 14:35:51 +0100
John Mistler wrote on Wed, 23 Jun 2004 20:04:42 -0700:
>
Given say, 188 seconds, is there a simple way to convert the number to
>
either "00:03:08" or "03:08"?
This is good for any positive number of seconds under 100 hours:
on secondsToTimeStr(t)
tell (1000000 + t div hours * 10000 + t mod hours div minutes * 100 +
t mod minutes) as string
return text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7
end tell
end secondsToTimeStr
secondsToTimeStr(188)
--> "00:03:08"
NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.