Re: Coercing date to real
Re: Coercing date to real
- Subject: Re: Coercing date to real
- From: David Lloyd <email@hidden>
- Date: Fri, 08 Feb 2002 20:07:26 +1100
Hello all...
>
> This is the easiest way I know to get the current date as a real:
>
> (current date) - (get date 0).
>
Can't make some data into the expected type.
Likewise...
I can coerce a date to a number on my machine
(with no "naughty oxen installed) thus:
set startDate to date "Friday, 01 January 1904 12:00:00 am"
set currentDate to (current date)
set dateAsReal to currentDate - startDate
-- > 3.096042897E+9
(I suppose the startDate can be anything,
but I've chosen Apple's 'beginning of time' date.)
Also:
>
try pulling the date as the ticks (the number of seconds):
Is not a tick a sixtieth of a second?
Cheers,
David Lloyd
---------------------------------
email: email@hidden
web:
http://www.kanzu.com
---------------------------------
_______________________________________________
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.