Re: Date manipulation
Re: Date manipulation
- Subject: Re: Date manipulation
- From: kai <email@hidden>
- Date: Sat, 8 Jul 2006 17:57:21 +0100
On 8 Jul 2006, at 16:39, Michelle Steiner wrote:
On Jul 8, 2006, at 8:23 AM, Adam Bell wrote:
set today to date "Tuesday, July 8, 2008 8:00:00 AM"
set sub to 11
set time of today to (time of (today - 1 * days)) + (24 - sub) *
hours
today
That sets the date to the future...
Right. The expression [(time of (today - 1 * days))], or [time of
(today - days)], would return the same value as [time of today], so
any value added to that would increment the time. Unless, that is,
the value of 'sub' happens to be greater than the date's hours + 24 -
in which case, the same coercion error would then result.
A date value's time property is an integer that specifies the number
of seconds since midnight of the date in question. You can't set it
to a negative value:
--------
set time of (get current date) to -1
--> error number -1700: "Can't make some data into the expected type."
--------
---
kai
_______________________________________________
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