• 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: new (I think) time question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new (I think) time question


  • Subject: Re: new (I think) time question
  • From: Doug McNutt <email@hidden>
  • Date: Sun, 6 Sep 2009 13:31:46 -0600

At 13:05 -0600 9/6/09, Robert Poland wrote:
set pad to "0"
set h to (time of WakeUpTime) div (1 * hours)
if h < 10 then set h to pad & h
set m to ((time of WakeUpTime) mod (1 * hours)) div (1 * minutes)
if m < 10 then set m to pad & m
set s to (time of WakeUpTime) mod (1 * hours) mod (1 * minutes)
if s < 10 then set s to pad & s

display dialog (h & ":" & m & ":" & s)

In undiluted UNIX there is a time value that is the number of seconds since Jan 0 1970. In the Mac classic OS it's a number of seconds since Jan 0 1904. In many spreadsheets there is a time value that is a double precision float that is the number of days and fractional parts thereof since Jan 0 1904 or Jan 1 1900 (with a known and correctable error).

In all of those cases one can use ordinary arithmetic operators to muck with date/time values so long as you know the correct zero point and unit of time. Formatting functions are available for hundreds of date formats.

Does AppleScript use one of those date/time values for internal storage? Is it documented? This whole thread would be trivial if AppleScript, thought of as a human, wanted to work the way others do. Is (1 * hours) the same as 3600? Or is it 1/24?
--

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: new (I think) time question
      • From: Yvan KOENIG <email@hidden>
References: 
 >new (I think) time question (From: Robert Poland <email@hidden>)
 >Re: new (I think) time question (From: Yvan KOENIG <email@hidden>)
 >Re: new (I think) time question (From: Robert Poland <email@hidden>)
 >Re: new (I think) time question (From: Yvan KOENIG <email@hidden>)
 >Re: new (I think) time question (From: Deivy Marck Petrescu <email@hidden>)
 >Re: new (I think) time question (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: new (I think) time question
  • Next by Date: Re: new (I think) time question
  • Previous by thread: Re: new (I think) time question
  • Next by thread: Re: new (I think) time question
  • Index(es):
    • Date
    • Thread