Re: Date computation
Re: Date computation
- Subject: Re: Date computation
- From: Barry Wainwright <email@hidden>
- Date: Fri, 07 Jan 2005 21:22:44 +0000
On 7/1/05 8:18 am, "Michelle Steiner" <email@hidden> wrote:
> I've run into a brick wall here. I'm trying to compute the date of the
> second Wednesday of the current month, and if the current date is later
> than or equal to that date, then compute the date of the second
> Wednesday of the following month.
>
> -- Michelle
This should load the script in full:
http://tinyurl.com/49lwf
If that doesn't work, then copy/paste from here (watch out for linewraps):
set today to current date
set secondWednesday to (word 4 of paragraph 4 of (get do shell script "cal")
as integer) mod 7 + 7
if secondWednesday > day of today then
set day of today to secondWednesday
return today
else
set {theYear, theMonth} to {year of today, month of today as integer}
if theMonth = 12 then
set {theMonth, theYear} to {1, theYear + 1}
else
set theMonth to theMonth + 1
end if
set secondWednesday to (word 4 of paragraph 4 of (get do shell script
"cal " & theMonth & " " & theYear) as integer) mod 7 + 7
return date ("" & secondWednesday & "/" & theMonth & "/" & theYear) --
change the order of these elements for US date format
end if
--
Barry
_______________________________________________
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