Next: Formatting Dates, Up: Time and Date [Contents][Index]
As in UNIX, Librep measures time as the number of seconds since January 1st, 1970 (known as the epoch).
For historical reasons Librep stores “timestamp”s as a pair of integers, using a cons cell. The first integer records the number of whole days since the epoch, the second records the number of seconds since the start of the day (in universal time).
Return the number of seconds since the epoch, in a cons-cell.
(current-time) ⇒ (10744 . 61063)
Ensure that the two parts of timestamp (a pair or integers) are consistent, simply that the number of seconds is less than the number of seconds in a whole day. If not, the timestamp is adjusted to meet this constraint.
Returns true if timestamp-1 is later than timestamp-2.
On the plus side, this scheme won’t wrap around as quickly as UNIX’s
time_t
will ;-)
The rep.util.time
module also provides some functions for
manipulating timestamps:
Convert timestamp to an integer, the number of seconds since the epoch that it represents.
Convert from an integer seconds to a timestamp object.
Return the number of seconds difference between timestamp-1 and timestamp-2.
The number of seconds in a 24-hour day.