Re: last day of the month of a date
Re: last day of the month of a date
- Subject: Re: last day of the month of a date
- From: Barry Wainwright <email@hidden>
- Date: Thu, 15 Dec 2005 15:12:43 +0000
- Thread-topic: last day of the month of a date
Title: Re: last day of the month of a date
On 14/12/05 23:58, "Bernard Bernu" <email@hidden> wrote:
I'd like to get the last day of the month of a date, say current date.
The only "simple" way I found to get it is : (here adate is a valid date)
copy adate to newdate
set day of newdate to 1
set newdate to newdate + 31 * days
set day of newdate to 1
set newdate to newdate - 1 * days
I'm hopping something much simple could be done.
Any idea ?
The only operation I found on date is to add or subtract days or integers. Adding month or year seem not to work !
Bernard
Not sure why you can't add months, I have no problem, but here's my one line solution:
set newDate to (date ("1/" & (month of aDate) + 1 & "/" & year of aDate)) - 1
--
Barry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden