Re: Date math question
Re: Date math question
- Subject: Re: Date math question
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 09 Jun 2003 14:32:39 -0700
On 6/9/03 1:54 PM, "Chris Page" <email@hidden> wrote:
>
On Monday, Jun 9, 2003, at 11:34 US/Pacific, Paul Berkowitz wrote:
>
>
> 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.
>
>
What do you mean by "a call to 'date'"? Is 'date' a function? I thought
>
>
date "Jan 1"
>
>
was an object specifier, not a function call?
I don't know the right name name for it. Like 'alias', 'date' does some
extra stuff when you compile it : it converts the expression containing
'date' and the following string into a date object -IF IT CAN- otherwise it
errors "Invalid date and time". When you compile:
date "Jan 1"
It's no longer 'date "Jan 1"'; it displays as
date "Wednesday, January 1, 2003 12:00:00 AM"
or whatever is the appropriate long date format in the International Date &
Time System Preferences on your machine.
So 'call' is undoubtedly the incorrect work word. I just wanted to get
across that some operation was being carried out in the compilation process
more than what happens when you compile a variable name or a string. A date
object, and I guess a pointer to it, is being created, if the string is not
invalid. This seems to require its own separate operation before the date
object so created can be operated on by an arithmetic operator like " - ".
Date objects seem to store number equivalents (the number of seconds since
1/1/1904) which are used when you do arithmetic on them. None of this can
occur until the word 'date' and the string following is converted into a
date object. But that doesn't seem to be the case when the date object is on
the left side of an arithmetic operator: it's not being acted _upon_ there
and can be used without the separately resolving via a variable or the
explicit 'get'.
--
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.