• 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: Number of days left in the month
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Number of days left in the month


  • Subject: Re: Number of days left in the month
  • From: Nigel Garvey <email@hidden>
  • Date: Fri, 22 Nov 2002 09:46:13 +0000

I wrote on Fri, 22 Nov 2002 03:21:24 +0000:

>Emmanuel also wrote on Thu, 21 Nov 2002 22:56:51 +0100:
>
>>Now the one-liner:
>>
>>tell theDate to 32 - (((date ("1 " & its month & " " & its year)) +
>>31 * days)'s day) returning x
>
>Or, about twice as fast (on my machines):
>
> tell (date (theDate's date string)) to 32 - ((it + (32 - (its day)) *
>days)'s day) returning x

Emmanuel will immediately have spotted (as will Arthur, has, etc.) that
the string's a complete waste of time in my version, so:

tell theDate to 32 - ((it + (32 - (its day)) * days)'s day) returning x

... which is very much faster still. :-)

NG
_______________________________________________
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.

  • Follow-Ups:
    • Re: Number of days left in the month
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: Viola...
  • Next by Date: Re: lock the screen from the keyboard, win a prize
  • Previous by thread: Re: Number of days left in the month
  • Next by thread: Re: Number of days left in the month
  • Index(es):
    • Date
    • Thread