Re: date/Snow Leopard changed
Re: date/Snow Leopard changed
- Subject: Re: date/Snow Leopard changed
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 7 Sep 2009 08:44:36 -0400
On Mon, Sep 7, 2009 at 2:13 AM, Paul Berkowitz<email@hidden> wrote:
> On 9/6/09 6:32 PM, "email@hidden" <email@hidden> wrote:
>
> More longwinded than the Hypertalk example but should get the job done?
>
> Slightly shorter-winded, perhaps:
>
> set TestDate to current date
> tell TestDate to set {its year, its month, its day, its hours, its minutes,
> its seconds} to {2000, 1, 2, 3, 4, 5}
>
> It makes no difference what order you put the lists, as long as the value
> you want corresponds to the same position in the property list, of course.
Again: the above does not work in all cases, and the order absolutely matters.
If you have a date object whose month is 2, setting the day to 30 (or
29 when the year is not leap) changes the month and day to {3,1} or
{3,2}.
If you have a date object whose day is already one of those values,
setting the month to 2 has the same effect.
The same thing goes for any 30-day month and day=31.
And as I posted, doing both sets at the same time using list
assignment doesn't help.
If the current date were September 30 instead of the 7th, this code:
set TestDate to current date
tell TestDate to set {its year, its month, its day, its hours, its
minutes, its seconds} to {2000, 2, 1, 3, 4, 5}
would yield a value of March 1st instead of the intended February 1st.
--
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:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden