time since the epoch

Mike T. Machenry dskippy@ccs.neu.edu
Fri, 31 Jan 2003 16:20:29 -0500


I am looking for a simple way to get the current days sincethe epoch. Most
language's standard time library have a get-seconds function that returns
the number of seconds since the epoch, thus the function is for example
in scheme:

(define (days-since-epoch)
  ((get-seconds) / (* 60 60 24)))

But it seems that in haskell the standard definition for the time library
will not give me seconds since the epoch. There is technically enough
information in the CalendarTime structure to calculate it, but it is a
pretty complicated algorithm. Not to mention the fact that it is the
exact opposite of the algorithm used to get that information in the first
place, so I'd like to not have to undo it and just get the seconds as they
are.

Thanks for the help
-mike