• 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: Emmanuel <email@hidden>
  • Date: Fri, 22 Nov 2002 15:11:22 +0100

At 9:46 AM +0000 22/11/02, Nigel Garvey wrote:

tell theDate to 32 - (((date ("1 " & its month & " " & its year)) +
>>31 * days)'s day) returning x

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

Waow. That one is pretty cleaner.

On the same scheme, you can get the number of seconds in the day:

--------------------------
tell theDate to 99999 - ((it + (99999 - (its time)))'s time) returning x
--> 86400
--------------------------

(IIRC there has been in the past a date which would not give 86400, but I don't remember when it was)

> you can't "set x to tell blah" but you can "tell blah returning x".

And you can "tell blah to set x".

Yes. My point was to be copy-paste compatible.

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

References: 
 >Re: Number of days left in the month (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: lock the screen from the keyboard, win a prize
  • Next by Date: Re: Execute script code in email body
  • 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