Re: Second-Time conversion
Re: Second-Time conversion
- Subject: Re: Second-Time conversion
- From: Martin Orpen <email@hidden>
- Date: Thu, 24 Jun 2004 16:47:18 +0100
on 24/6/04 5:21 am, Graff at email@hidden wrote:
>
The second way uses good old math and should work fine as long as you
>
don't feed it something odd like a negative amount of seconds:
>
----
>
on TimeToString(theTime)
>
set theSec to theTime mod 60
>
set theMin to (theTime mod 3600) div 60
>
set theHour to theTime div 3600
[snip]
That's a bit like mine:
set t to 273
set h to t div 3600
set tr to (t mod 3600)
set x to (tr div 60)
set m to leadZero(x)
set x to (tr mod 60)
set s to leadZero(x)
h & ":" & m & ":" & s as string
on leadZero(x)
if x is less than 10 then
return "0" & x
else
return x
end if
end leadZero
-->{"John Cage"}
:-)
--
Martin Orpen
Idea Digital Imaging Ltd -- The Image Specialists
http://www.idea-digital.com
_______________________________________________
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.