Re: Date manipulation
Re: Date manipulation
- Subject: Re: Date manipulation
- From: kai <email@hidden>
- Date: Sat, 8 Jul 2006 16:26:16 +0100
On 8 Jul 2006, at 15:54, Michelle Steiner wrote:
This works:
set today to date "Tuesday, July 8, 2008 8:00:0 AM"
set time of today to (time of today) + anything
This doesn't:
set today to date "Tuesday, July 8, 2008 8:00:0 AM"
set time of today to (time of today) - something
if "something" causes "today" to be the previous day (or earlier).
However, it works if it causes it to be earlier in the same day.
--> "Can't make some data into the expected type."
I guess that's because subtracting any value larger than a date's
time results in a negative value - and you can't set a time to a
negative value, Michelle. It's probably better to apply such
adjustments to the date itself:
----------
set today to date "Tuesday, July 8, 2008 08:00:00"
set today to today - 9 * hours
--> date "Monday, July 7, 2008 23:00:00"
----------
(In this case, of course, the variable label 'today' is no longer
particularly appropriate. ;-))
---
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