• 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: Speaking of date arithmetic...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speaking of date arithmetic...


  • Subject: Re: Speaking of date arithmetic...
  • From: Luther Fuller <email@hidden>
  • Date: Mon, 03 May 2010 19:28:34 -0500

On May 3, 2010, at 6:50 PM, Michelle Steiner wrote:

Did you know you could subtract days of the week from each other?  Or add them together?  Don't know what good the latter will do, though.

(Wednesday) - Tuesday
--> 1

(Wednesday) - Thursday
--> -1

(Wednesday) + Thursday
--> 9

The first day must be in parentheses.  You can also add or subtract reals from them, but the result is a number, not a day of the week.

You can even multiply, but not divide, them by each other or by a real.  Can't raise them to a power, either.

And you can also do pointless things like ...

(December) + (Friday) --> 18

It's best to keep it simple with something like

Sunday as integer

But you CAN write ...

(December as integer) / 4 --> 3.0

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Speaking of date arithmetic... (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Speaking of date arithmetic...
  • Next by Date: Sharing Applescripts
  • Previous by thread: Speaking of date arithmetic...
  • Next by thread: Sharing Applescripts
  • Index(es):
    • Date
    • Thread