Copyright (C) 2000-2012 |
GNU Info (librep.info)TimestampsTimestamps ---------- As in UNIX, `librep' measures time as the number of seconds since January 1st, 1970 (known as the "epoch"). For historical reasons rep stores timestamps 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). These function are exported by the `rep.system' module: - Function: current-time Return the number of seconds since the epoch, in a cons-cell. (current-time) => (10744 . 61063) - Function: fix-time timestamp 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. - Function: time-later-p timestamp-1 timestamp-2 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: - Function: time->seconds timestamp Convert TIMESTAMP to an integer, the number of seconds since the epoch that it represents. - Function: seconds->time seconds Convert from an integer SECONDS to a timestamp object. - Function: time- timestamp-1 timestamp-2 Return the number of seconds difference between TIMESTAMP-1 and TIMESTAMP-2. - Constant: seconds-per-day The number of seconds in a 24-hour day. automatically generated by info2www version 1.2.2.9 |