On Thu, 28 Oct 1999 [EMAIL PROTECTED] wrote:

> 
> In Perl <*shudder*> and Unix, you can use the number of seconds from the
> Epoch (January 1, 1970) in programs. How can I do this in Rebol; i.e. get
> the number of seconds from the Epoch?
> 
> --Ralph
> 


Well, here's a rather ugly piece of code that should take care of it.
I think. I'm using it in my IRC client. Maybe the date datatype has a
/path that does this, I don't know.

date-to-integer: func [
  date
  /local
  the-date
  the-time
][
  the-time: date/time
  the-date: make date! reduce [
    date/year date/month date/day
  ]
  (the-date - 1970-1-1) * 86400 + 
  (the-time/hour * 3600) + 
  (the-time/minute * 60) + the-time/second
]

/Martin Johannesson, [EMAIL PROTECTED]

Reply via email to