Subtract 1 month from date
Subtract 1 month from date
- Subject: Subtract 1 month from date
- From: Eric Geoffroy <email@hidden>
- Date: Wed, 08 Dec 2004 15:37:21 -0800
Or 4 weeks I suppose. It's okay if it's not super precise.
I can say "d + 4 * weeks"
but it won't allow "d + 1 * months
and won't allow d - 1 * weeks
Output should look like this.
11/1/2004...12/1/2004
The idea is to coerce dates into range of past month for reporting porpoises. (purposes. I can't resist a good malapropism)
I guess I could coerce to numbers and do simple math like this: (pseudo code coming)
today's date as words
set mth to (word 1 as number) -1
set d to "1/" & mth & year
set d to (get current date)
set e to d - 4 * weeks
set {dMth, dDay} to words of (short date string of d) -- DD/MM/YY
set eMth to first word of (short date string of e)
set strDate to (dMth & "/1/" & year of d) as text
set endDate to (eMth & "1/" & year of e)
set searchrange to strDate & "..." & endDate
_______________________________________________
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