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: Emmanuel <email@hidden>
- Date: Thu, 21 Nov 2002 11:01:18 +0100
At 6:59 PM -0500 20/11/02, Marc K. Myers wrote:
Date: Wed, 20 Nov 2002 10:21:43 -0700
Subject: Number of days left in the month
From: Michelle Steiner <email@hidden>
To: email@hidden
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.
A while back I came up with a similar but slightly more compact way
of calculating the remaining days:
set theDiff to ((((date daysRemaining()) + days) - (current date)) /
days) div 1
on daysRemaining()
set lastDay to {"31", "30", "29", "28"}
repeat with i in lastDay
try
date i
return i
end try
end repeat
end daysRemaining
Still more compact:
================
48 - (day of ((date ("" & 1)) + 4060800))
================
--> 30
Emmanuel
_______________________________________________
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.