• 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: Coercing date to real
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: How to get frontmost application?
  • Next by Date: Filemaker not replying to events
  • Previous by thread: Re: How to get frontmost application?
  • Next by thread: Re: Coercing date to real
  • Index(es):
    • Date
    • Thread