Re: Milliseconds to "formatted time"
Re: Milliseconds to "formatted time"
- Subject: Re: Milliseconds to "formatted time"
- From: jj <email@hidden>
- Date: Sat, 16 Jul 2005 10:15:36 +0200
> Before re-inventing the wheel, there is a quick (or fast) and vanilla
> solution to convert milliseconds to a formatted time string? Eg:
Well, here is a sample supporting 24-hours formatting:
millisecToFormattedTime(4806790) --> "01:20:06.790"
to millisecToFormattedTime(tMs)
set finalHours to tMs div 3600000
set remMS to tMs mod 3600000
set finalMins to remMS div 60000
set remMS to remMS mod 60000
set finalSecs to remMS div 1000
set remMS to remMS mod 1000
return "" & (text -2 thru -1 of ("00" & finalHours)) & ":" & (text -2
thru -1 of ("00" & finalMins)) & ":" & (text -2 thru -1 of ("00" &
finalSecs)) & "." & (text -3 thru -1 of ("00" & remMS))
end millisecToFormattedTime
jj
--
http://www.macscripter.net/
http://www.osaxen.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden