• 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: Simple date question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Simple date question
      • From: Bernardo Hoehl <email@hidden>
References: 
 >Re: Simple date question (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Serial i/o OSAX for OS X?
  • Next by Date: Re: AppleScript feature request - encryption
  • Previous by thread: Re: Simple date question
  • Next by thread: Re: Simple date question
  • Index(es):
    • Date
    • Thread