• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Second-Time conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Second-Time conversion
      • From: Graff <email@hidden>
References: 
 >Re: Second-Time conversion (From: Graff <email@hidden>)

  • Prev by Date: Re: Second-Time conversion
  • Next by Date: QuarkXPress 6 Spread Finder
  • Previous by thread: Re: Second-Time conversion
  • Next by thread: Re: Second-Time conversion
  • Index(es):
    • Date
    • Thread