Bo,
Thanks for your reply.
Deryk Robosson sent me these two functions that work like a charm:
get-epoch: func [date][
date: make date! date
seconds: ((date - 1-1-1970) * 86400) + (date/time/hour * 3600) +
(date/time/minute * 60) + date/time/second
zone: now/zone
zone: zone/hour
zone: zone * 3600
seconds: seconds - zone
return seconds
]
from-epoch: func [epoch [integer!]][
days: divide epoch 86400
days2: make integer! days
time: (days - days2) * 24
hours: make integer! time
minutes: (time - hours) * 60
minutes2: make integer! minutes
seconds: make integer! (minutes - minutes2) * 60
time2: make time! ((((hours * 60) + minutes2) * 60) + seconds)
return time2
]
Doug
=====================
On Thursday, 13 July 2000 you wrote:
Doug,
Do you mean like this:
>> to-idate now
== "Wed, 12 Jul 2000 15:52:42 -0700"
Or did you have a different format in mind?
On 12-Jul-2000/18:19:59+10:00, [EMAIL PROTECTED] wrote:
>Is there a function for converting a date to a unix timestamp?
>
>Doug
>
>
--
Bohdan "Bo" Lechnowsky
REBOL Adventure Guide
REBOL Technologies 707-467-8000 (http://www.rebol.com)
Download the REBOL Messaging Language
The Official Source for REBOL Books (http://www.REBOLpress.com)