• 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: Yvan KOENIG <email@hidden>
  • Date: Sun, 6 Sep 2009 21:40:34 +0200


Le 6 sept. 2009 à 21:31:46, Doug McNutt a écrit :
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?
-- 


set wakeTime to "1:00"
set WakeUpTime to short date string of (current date)
set WakeUpTime to date (WakeUpTime & space & wakeTime)
log time of WakeUpTime

returns 3600

Are you satisfied ?

Yvan KOENIG (VALLAURIS, France) dimanche 6 septembre 2009 21:38:30


 _______________________________________________
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

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>)
 >Re: new (I think) time question (From: Doug McNutt <email@hidden>)

  • Prev by Date: Re: new (I think) time question
  • Next by Date: Re: date/Snow Leopard changed
  • Previous by thread: Re: new (I think) time question
  • Next by thread: Re: new (I think) time question
  • Index(es):
    • Date
    • Thread