Re: Days and hours
Re: Days and hours
- Subject: Re: Days and hours
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 19 Oct 2005 23:48:51 -0400
On 10/19/05,
Nigel Garvey <
email@hidden> wrote:
>set myDate to current date
>set year of myDate to 1968
>set month of myDate to May
>set day of myDate to 5
>set time of myDate to (20 * 60 + 47) * 60
There's a potential problem with this method, in that unless all the
elements of the current date are compatible with the date you want to
create, you'll get errors.
Not errors, unless you mean "potentially erroneous results". AppleScript automatically adjusts to legal dates.
If the script's run on 29th February 2008, the
second line will error if the target's in a non-leap year.
Nope. It will just adjust the rest of the date to March 1st.
tell (current date) to set {day, year, its month, day, time, myDate} to
{1, 1968, May, 5, 20 * hours + 47 * minutes, it}
I do like that method, however. Nice and (relatively) succinct. Thanks!
--
Mark J. Reed <
email@hidden>
_______________________________________________
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