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: deivy petrescu <email@hidden>
- Date: Wed, 14 Dec 2005 22:13:16 -0500
On Dec 14, 2005, at 21:59, Mark J. Reed wrote:
Adding 31 doesn't necessarily get you next month; on January 29th or
later, it skips right over February to March, and the same thing
happens of today is the last day of March, May, August, or October.
This works for any date, at least on Tiger:
copy (current date) to d
set month of d to (month of d) + 1
set day of d to 1
(d - 1 * days)
It does if you are on the first day of the month.
The first thing the OP does is to put the date on the first day of
the current month.
It does not matter. Your script is better and you just pointed out
something very interesting:
<script>
set l to February + 1
--> error: Can't make February 1 into type reference.
</script>
but
<script>
set j to (February) + 1
--> 3
</script>
Thanks!
deivy
_______________________________________________
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