I believe the below code is slightly off because it does not take into
account your time zone. I wound up doing it like this:

date: now

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     ; minus a minus gives plus

print seconds


--Ralph

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 22, 1999 11:03 AM
> To: [EMAIL PROTECTED]
> Subject: [REBOL] time function Re:
>
>
> Hi...  There was quite a discussion of this question back at the end of
> October... which then became a discussion of Julian dates.  I
> think this was
> the most elegant/simplest answer to your question though.. thanks to
> msg#43926 from Thomas Jensen:
>
> epoch: func [] [
>    x: (* now - 1-1-1970 86400) + now/time  ; returns a time! value
>    x/3 + ((x/1 * 60) + x/2 * 60)           ; converts to seconds,
> would be nice
>                                            ; if (to integer! x) worked...
>  ]
>
> Russ
> -------------------------------------
> At 09:30 AM 11/22/99 +0000, you wrote:
> >Hello everyone....forgive a newbie question....Perl has a time function
> >which returns a number of seconds since a certain date. With
> Rebol I can get
> >now/time, now/date, etc. Is there an easy way to get the same
> type of value
> >that the Perl time() function returns? I seem to have problems
> multiplying
> >what returns from now with integer or decimal data types, like
> in a payroll
> >calculation where hours_worked * pay_rate = paycheck. Thanks in
> advance for
> >your help.
> >
> >Rebol rules!
> >
> >______________________________________________________
> >Get Your Private, Free Email at http://www.hotmail.com
> >
> >
> >
>

Reply via email to