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

Re: Date anomaly


  • Subject: Re: Date anomaly
  • From: Andrew <email@hidden>
  • Date: Mon, 03 Mar 2003 12:23:34 -0500

On 3/3/03 7:35 AM, "Nigel Smith" <email@hidden> wrote:

> On 2/3/03 10:33, "John Delacour" <email@hidden> wrote:
>
>> set d to "1/1/1"
>> date d
>> --> date "Monday, January 1, 2001 12:00:00 am"
>>
>> try
>> (current date) - (date d)
>> on error e
>> e
>> end try
>> --> Can't make date "Monday, January 1, 2001 12:00:00 am" into a
>> number or date.
>
> But:
> (date d) - (current date)
>
> will work. It is almost like there is some implicit coercion if the compiler
> spots "current date" earlier in the line than "date d" and tries to make a
> date into a date -- which begs the question why the coercion fails if you


this works as well

set d to "1/1/1"
date d
--> date "Monday, January 1, 2001 12:00:00 am"

try
(current date) - ((date d) as date)
on error e
e
end try

the value of (date d) doesn't appear to return be something of class date..!

The get command looks like it returns the right thing as does doing an "as
date".... Some sort of casting appears to be happening when that is done..
_______________________________________________
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: Date anomaly (From: Nigel Smith <email@hidden>)

  • Prev by Date: Re: plist and AppleScript [WAS: Scripting]
  • Next by Date: Re: Cocoa Loco
  • Previous by thread: Re: Date anomaly
  • Next by thread: Re: Date anomaly
  • Index(es):
    • Date
    • Thread