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

Re: Date math question


  • Subject: Re: Date math question
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 09 Jun 2003 11:34:32 -0700

On 6/9/03 11:14 AM, "Michelle Steiner" <email@hidden> wrote:

>
> On Monday, June 9, 2003, at 10:46 AM, Paul Berkowitz wrote:
>
>> It has to be resolved first:
>>
>> (date foo) - (get date bar)
>
> So why does one have to have the get, but not the other one?

Because the second has a second operand, namely the subtraction operation,
needing to work on it. AFAICS, a call to 'date' is needed to "convert" the
'date' command plus an appropriate string to the date data type, before you
can do anything with it. In the first case (date foo), that's fine, that's
what it does. In the second case (date bar, without the explicit get) ,
you're trying to subtract something that isn't yet a date data type, so it
errors. As usual the error message isn't overly helpful. In the third case
(get date bar with explicit get) you force the conversion to date data type
within the parentheses first, before the " - " operator goes to work, so all
is OK.

--
Paul Berkowitz
_______________________________________________
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: Date math question
      • From: Chris Page <email@hidden>
References: 
 >Re: Date math question (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Date math question
  • Next by Date: Re: Bug in iTunes?
  • Previous by thread: Re: Date math question
  • Next by thread: Re: Date math question
  • Index(es):
    • Date
    • Thread