• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Number of days left in the month
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Number of days left in the month (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Execute script code in email body
  • Next by Date: footprint in pdf
  • Previous by thread: Number of days left in the month
  • Next by thread: Re: Number of days left in the month
  • Index(es):
    • Date
    • Thread