Re: Number of days left in the month
Re: Number of days left in the month
- Subject: Re: Number of days left in the month
- From: Nigel Garvey <email@hidden>
- Date: Thu, 21 Nov 2002 18:32:24 +0000
has wrote on Thu, 21 Nov 2002 14:23:54 +0000:
>
I think Nigel Garvey's the best man to ask about date math. (Seems to be
>
laying low recently; maybe he's been busy?
Lying low, uninspired by current discussions, still using Mac OSes 8.6
and 9.2, busy musically, etc.... But thanks for the plug. :-)
>
Try searching ScriptBuilders at
>
macscripter.com - I know he's got at least one collection of date scripts
>
posted there.) There's also some useful stuff on my own site (dateLib,
>
calendarLib).
>
>
Anyway...
>
>
======================================================================
>
>
on daysInMonth(theDate) -- [date math a-la NG]
>
copy theDate to tmpDate
>
set tmpDate's day to 32
>
set tmpDate's day to 1
>
return day of (tmpDate - (1 * days))
>
end daysInMonth
I contributed a later version of this to the discussion on
alt.comp.lang.applescript yesterday - and then realised about three hours
later that it could be simplified to:
on daysInMonth(theDate)
copy theDate to tmpDate
set tmpDate's day to 32
return 32 - (tmpDate's day)
end daysInMonth
NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.