• 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: Days and hours
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Days and hours


  • Subject: Re: Days and hours
  • From: Yvan KOENIG <email@hidden>
  • Date: Thu, 20 Oct 2005 15:03:41 +0200


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: This email sent to email@hidden
References: 
 >Re: Days and hours (From: Emile Schwarz <email@hidden>)

  • Prev by Date: Re: Dialog simple question
  • Next by Date: Re: Days and hours
  • Previous by thread: Re: Days and hours
  • Next by thread: Re: Days and hours
  • Index(es):
    • Date
    • Thread