• 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: Deivy Petrescu <email@hidden>
  • Date: Wed, 12 Mar 2003 22:32:24 -0500

On Monday, Mar 3, 2003, at 21:07 US/Eastern, Christopher Nebel wrote:

On Sunday, March 2, 2003, at 03:17 AM, John Delacour wrote:

At 10:33 am +0000 2/3/03, John Delacour wrote:

Can anyone explain why I'm getting this problem?

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

(current date) - (date d)
--> Can't make date "Monday, January 1, 2001 12:00:00 am" into a number or date.

Solved it, but this is new. It seems everything has to be GOT nowadays :-<

As far as I can tell, this has never worked. I tried 1.1.2, 1.3.7, 1.8.3, and 1.9.1. It's a bug, or at least I'd consider it one -- something about not automatically evaluating object specifiers. ("date d" isn't a date, it's an object specifier that refers to a date.) As you discovered, an explicit "get" will clear this up.


--Chris Nebel
AppleScript Engineering
_______________________________________________


Chris, you said that "date d" isn't a date.
But, check this out:

<script>
set d to "1/1/1"
log class of date d --------> date
log date d -------------------> (*Monday, January 1, 2001 0:00:00*)
set k to date d
log class of k ----------------> date
try
(current date) - (date d)
on error e
e -----------------------> "Can't make date \"Monday, January 1, 2001 0:00:00\" into a number or date."
end try
<script>


Exchanging k with date d works.
I've had other times when I had to coerce a class into itself to make the script work.
Hard to understand why this would happen some times.
Thanks for any clarification.
_______________________________________________
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 anomaly
      • From: Christopher Nebel <email@hidden>
References: 
 >Re: Date anomaly (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Remove a Person from Address Book
  • Next by Date: Re: Illustrator scripting syntax
  • Previous by thread: Re: Date anomaly
  • Next by thread: Re: Date anomaly
  • Index(es):
    • Date
    • Thread