Re: Simple date question
Re: Simple date question
- Subject: Re: Simple date question
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 15 Mar 2005 11:12:45 -0800
On 3/15/05 11:01 AM, I wrote:
> On 3/15/05 10:40 AM, "Bernardo Hoehl" <email@hidden> wrote:
>
>> This is a simpe one:
>>
>> How do I get the last day of the current month?
>>
>> Example: february 2005 = 28 or March =31
>
>
> set theDate to (current date)
> set day of theDate to 1
> set theDate to theDate + (31 * days)
--oops
> set day of theDate to 1
> set theDate to theDate - (1 * days)
> set d to day of theDate
Actually that's no good if today is Jan 30, for example. It would get the
last day of _next_ month (28) instead of this month (31).
Andrew's way (which might originally be Nigel's way, in fact) - setting the
day to 32 - is accurate in all cases.
--
Paul Berkowitz
_______________________________________________
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