Next: , Previous: , Up: iklib time   [Index]


6.49.2 Time spans since the Epoch

Time spans since the Epoch are represented by instances of <epoch-time> objects, which is a disjoint object–type; the object–type <epoch-time> is a subtype of <time>. An <epoch-time> object represents the time elapsed since the Epoch as determined by the POSIX function clock_gettime() with the argument CLOCK_REALTIME; (*manpages*)Clock and time functions.

The following bindings are exported by the library (vicare).

Function: <epoch-time> make-epoch-time {seconds <exact-integer>} {nanoseconds <fixnum>}

Build and return a new <epoch-time> object. The arguments are normalised as explained for make-time.

Function: <epoch-time> current-time

Return an instance of <epoch-time> representing the current time elapsed since the Epoch as determined by the POSIX function clock_gettime() ((*manpages*)Clock and time functions) with the argument CLOCK_REALTIME.

Function: <epoch-time> faraway-time

Return an instance of <epoch-time> representing a time since the Epoch that is “far” in the future.

Function: <boolean> epoch-time? obj

Return #t if obj is a <epoch-time> object; otherwise return #f.

Function: <boolean> list-of-epoch-times? obj

Return #t if obj is a (possibly empty) proper list of <epoch-time> objects; otherwise return #f.

Function: <fixnum> time-gmt-offset

We can interpret the Epoch time as time as expressed in the UTC or GMT+00 time zone. This function returns the offset in seconds from the local time zone to UTC; in Rome (GMT+01) this function returns 3600.

Function: <epoch-time> epoch-time-addition {ET <epoch-time>} {T <time>}

Add T to ET and return the result.

Function: <epoch-time> epoch-time-subtraction {ET <epoch-time>} {T <time>}

Subtract T from ET and return the result.


Next: , Previous: , Up: iklib time   [Index]