Subject: | |
From: | |
Reply To: | |
Date: | Fri, 19 May 2006 18:45:33 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On May 19, 2006, at 10:14 AM, Duane L. Mitchell wrote:
> On 5/19/06 12:34 PM John Delacour [log in to unmask] said:
>
>
>> In 10.4.6 'display dialog' will automatically coerce the sci notation
>> to string provided to don't try your own coercion first.
>>
>> But I'm guessing you don't want a dialog and the simplest trick I
>> know of is to get Perl to do it, as below:
>>
>>
>> property pReferenceDate : "1/1/1803"
>> set vDocNumber to ((current date) - (get date pReferenceDate))
>> --=> 6.418113912E+9
>> display dialog "" default answer vDocNumber
>> -- or
>> do shell script "perl -e 'print " & vDocNumber & "'"
>> --=> 6418114152
>
> John, thanks. The display dialog was thrown in for my testing, I
> should have
> noted that, it's not used anywhere in the actual script. The OS
> versions
> that the script is running on is 10.4.4 and 10.4.5. When the user
> runs the
> script they error.
>
> Thanks for the Perl script, I may end up using it!
I'm having trouble seeing this as a configuration issue. An
AppleScript date object (about whose contents we know nothing of
course*) simply contains a signed 64 bit number of seconds. The
difference between two of them is a number of seconds.
If the difference is large enough, AppleScript will use floating
point to store it (AppleScript integers are less than 32 bits long).
Could it be that the reference date value is messed up on the system
of the client with the problem?
Actually, despite my first sentence, I suppose the system's
configuration could lead to that--parsing of a text date is rather
forgiving, but might not have been forgiving enough.
Where does the reference date come from?
* I find it hard to believe that Apple would use a different format
in Intel-land, but, since we don't know the format, that is possible.
--John
|
|
|