Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Days and hours




Le 20 oct. 2005 , à 10:51, Emile Schwarz a écrit :

Hi,

just for the fun, I tried:

-- use your clock own format below
-- except if its settings are French / OS Language: Français
set myDate to date "jeudi 20 octobre 2005 5:10:15"


-- Change that date to March 2nd, 1954; 11:45:00 -- a. DD:MM:YYYY set day of myDate to 2 set month of myDate to March set year of myDate to 1954

-- b. HH:MM:SS
set hours of myDate to 11
set minutes of myDate to 45
set seconds of myDate to 0

-- give me the newly computed date
return myDate


and get a "Saturation de la pile" (sic) and "set hours of myDate to 11" (without quotes) highlighted...


go figure... it is not possible to do the obvious... where are we going to darling ? ;)



Hello Emile

I was close to write that you are right … most of the time ;-)

This time, you are wrong !

As far as I know, the AppleScript language guide claims that:
hours and minutes, like days and weeks are NOT properties of a date BUT are constants.


An AS date_time count a number of seconds since 01/01/1904 (If I remember well)

the constant minutes is defined as 60 (seconds)
the constant hours is defined as (60 x minutes)
the constant days is defined as (24 x hours)
the constant weeks is defined as (7 x days)

-- use your clock own format below
-- except if its settings are French / OS Language: Français
set dd to "20/10/2005"
set myDate to date dd
--set myDate to date "20 octobre 2005  5:10:15"

(*
-- Change that date to March 2nd, 1954; 11:45:00
-- a. DD:MM:YYYY
set day of myDate to 2
set month of myDate to March
set year of myDate to 1954
set date1 to get myDate
*)
-- b. HH:MM:SS
set time of myDate to (11 * hours) + (45 * minutes) + 0

-- give me the newly computed date
return myDate


Yvan KOENIG _______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Re: Days and hours (From: Emile Schwarz <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.