Re: Subtract 1 month from date
Re: Subtract 1 month from date
- Subject: Re: Subtract 1 month from date
- From: Nigel Garvey <email@hidden>
- Date: Thu, 9 Dec 2004 16:04:20 +0000
kai wrote on Thu, 9 Dec 2004 04:45:38 +0000:
>The last line assumes you're running in Panther (which I'm currently
>not - so I'm just guessing how it might work). Alternatively, and
>borrowing blatantly from Nigel's suggestion, this may do it:
>
>---------------------
>
>on firstOfMonthUS(d)
> copy d to b
> set b's month to January
> ((b - 2500000 - d) div -2500000 as string) ¬
> & "/1/" & d's year
>end firstOfMonthUS
Neat! Hard-wiring the "/1/" into the handler. :-) With that, the rest
can be done with just one line:
tell (current date) to set searchrange to ¬
my firstOfMonthUS(it - day * days) & "..." & my firstOfMonthUS(it)
NG
_______________________________________________
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