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 Smith <email@hidden>
- Date: Fri, 22 Nov 2002 15:09:17 +0000
On 20/11/02 5:21 pm, "Michelle Steiner" <email@hidden> wrote:
>
Someone asked (on the A'script newsgroup) how to figure out how many
>
days are left in the current month, or how to compute the total number
>
of days in the current month.
Since this meshes in with another thread, here's a script with an extremely
long line to do similar:
set theDate to (current date) -- or whatever date you want
--the next is all one line
set daysOfMonth to day of ((date ((month of ((date ((month of theDate as
text) & " 1 " & year of theDate as text)) + (31 * days)) as text) & " 1 " &
year of theDate as text)) - 1)
--end of all one line
--then use the following
--for number of days left in month of theDate
return daysOfMonth - (day of theDate)
--for number of full days left in month of theDate
return (daysOfMonth - (day of theDate) - 1)
--for number of days in the month of the date
return daysOfMonth
Nigel
_______________________________________________
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.