Re: Subtract 1 month from date
Re: Subtract 1 month from date
- Subject: Re: Subtract 1 month from date
- From: Eric Geoffroy <email@hidden>
- Date: Thu, 09 Dec 2004 10:25:34 -0800
Thanks to all.
The restrictions on me are as follows:
1. I have to use the date settings in International Preferences as they default.
2. The FMPro5 database is set up in the DD/MM/YYYY format hence all of the manhandling of the dates.
I think given the wide range of responses, I should have plenty to work with here.
T'anks.
- Eric
On Dec 9, 2004, at 8:04 AM, Nigel Garvey wrote:
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
Eric Geoffroy
Media Producer
Peachpit Press
(510) 524-2178 x214
_______________________________________________
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