• 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: Human Readable Time snipit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Human Readable Time snipit


  • Subject: Re: Human Readable Time snipit
  • From: kai <email@hidden>
  • Date: Thu, 12 Oct 2006 01:31:57 +0100


On 11 Oct 2006, at 23:51, Nir Soffer wrote:

Here is a shorter, simpler and more readable version:

You could probably also indulge in a little date tomfoolery to achieve something similar. Makes it a bit shorter still (though no claims here about readability...) ;-)


Usual caution about line wraps.

--------------

on dhms_format from s
tell ((date ("1 " & "1")) + (s * s) ^ 0.5) to tell (1000000 + (its hours) * 10000 + (its minutes) * 100 + (its seconds)) as string to (s div days as string) & ":" & text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7
end dhms_format


dhms_format from 5.86574625E+8

--> "6789:01:23:45"

--------------

---
kai


_______________________________________________ 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
  • Follow-Ups:
    • Re: Human Readable Time snipit
      • From: Martin Orpen <email@hidden>
    • Re: Human Readable Time snipit
      • From: "Gary (Lists)" <email@hidden>
References: 
 >Human Readable Time snipit (From: "David A. Cox" <email@hidden>)
 >Re: Human Readable Time snipit (From: Nir Soffer <email@hidden>)

  • Prev by Date: Re: my 1st applescript - how to get value from record?
  • Next by Date: Re: triggering a script in Filemaker
  • Previous by thread: Re: Human Readable Time snipit
  • Next by thread: Re: Human Readable Time snipit
  • Index(es):
    • Date
    • Thread