• 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: Gary Lists <email@hidden>
  • Date: Mon, 09 Jun 2003 13:58:30 -0400

On or about 6/9/03 1:33 PM, Michelle Steiner wrote:

> This works:
>
> set foo to "jul 7"
> set bar to "jun 26"
> set foo to (date foo)
> set bar to (date bar)
> (foo - bar) / days
>
> This doesn't:
>
> set foo to "jul 7"
> set bar to "jun 26"
> (date foo) - (date bar)
>
> "(date bar)" is highlighted, with the error as shown below:
>
> --> Can't make date "Thursday, June 26, 2003 12:00:00 AM" into a number
> or date.
>
> How come?

Because the way that works is correct. ;)

Without any technical info to offer, direct manipulation of dates in date
math is not "cool". The way you did it is the right way, as I've learned
it. Set a variable/reference to the date and then operate on that. Makes
sense, actually.

Besides, the error is telling me something about the problem. The thing is
already a date and you're trying to make it into a date. At least that's
what the error suggests to me.

--
Gary

MacOS 9.1.2 / "9 is Fine"
OMM: osa:AS 1.8.3 / osa:JS 1.0.3 / FM 55 / BB601 / Smile 188
______________________________________________________________
Please reply directly to the list.
Incoming messages are auto-deleted. (It's anti-spam, that's all.)
_______________________________________________
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: Michelle Steiner <email@hidden>
References: 
 >Date math question (From: Michelle Steiner <email@hidden>)

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