• 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: 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.


  • Prev by Date: Re: Read resource forks wit applescript
  • Next by Date: Re: Second-Time conversion
  • Previous by thread: Re: Second-Time conversion
  • Next by thread: Re: Second-Time conversion
  • Index(es):
    • Date
    • Thread