Subject: | |
From: | |
Reply To: | |
Date: | Sun, 21 May 2006 12:53:59 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On 5/21/06 12:38 PM, "Duane L. Mitchell" <[log in to unmask]> wrote:
> On 5/19/06 9:45 PM John Baxter [log in to unmask] said:
>
>> Where does the reference date come from?
>
> I use the calculation to create a unique number that gets pasted into a Word
> document. This number then is a unique referenece number for that document.
> I use the following date as a reference which is subtracted from the current
> date:
>
> property pReferenceDate : date "Wednesday, January 1, 2003 12:00:01 AM"
>
> This date was chosen because it was the date this organization, a law firm,
> opened for business and using this date resulted in a number that is not too
> many digits in length...for awhile anyway.
>
> It's been working fine for over 3 years.
As an alternative to the example I gave (with emendation from Nigel), the
following should work for almost most computers, using either m/d/y or d/m/y
International Date & Time formats (leading zeroes or not) are used , but not
for formats like Swedish that use yyyy-mm-dd :
property pReferenceDate : "1/1/2003 00:00:01"
set pReferenceDate to date pReferenceDate
Then compile and save the script just before sending it off to others
_without running it_. Running it will re-save pReferenceDate as a date
object. So you'd be better off doing it like this:
property pRefDate : "1/1/2003 00:00:01"
set pReferenceDate to date pRefDate
You'd avoid the problem that way, even if you forget to re-compile and save
on future updates. But you'll still run into trouble if any of your users do
use the yyyy-mm-dd or similar year-first short date format on their
computers. You'd need to make a special version for them. Or use the other
(current date) method.
--
Paul Berkowitz
|
|
|