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
|