• 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: Last day of month....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Last day of month....


  • Subject: Re: Last day of month....
  • From: Nigel Smith <email@hidden>
  • Date: Thu, 21 Nov 2002 18:06:09 +0000

On 21/11/02 5:21 am, "David Crowe" <email@hidden> wrote:

> Here's a 1 line script that determines the last day of the month
> without try blocks ... and in one line too!
>
>
> set LastDayOfMonth to 27 + ((((date " March 1, 2003") - (date
> "February 28, 2003")) / (24 * 3600)) as integer)

Or, and shorter still,

set lastDayOfMonth to day of (date "March 1, 2003" - 1)

This implies you know the month after the month you want to know the last
day of, in which case the generic version is:
--------
return day of ((date ("" & month of nextMonth)) - 1)
--------

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: 
 >Last day of month.... (From: David Crowe <email@hidden>)

  • Prev by Date: Keychain scripting
  • Next by Date: Re: AppleScript 1.6 and Mac OS 8.6 - SOLVED
  • Previous by thread: Last day of month....
  • Next by thread: Re: [OT] Re: RegEx & Concordances
  • Index(es):
    • Date
    • Thread