Next: Machine Time Up: Time Previous: Time

## Real Time and Date

`(current-seconds)` returns the current time in seconds. This time is always an exact integer based on a platform-specific starting date (with a platform-specific minimum and maximum value).

The value of `(current-seconds)` increases as time passes (increasing by 1 for each second that passes). The current time in seconds can be compared with a time returned by `file-or-directory-modify-seconds` (see section 11.2.2).

`(seconds->date secs-n)` takes secs-n, a platform-specific time in seconds (an exact integer) returned by `current-seconds` or `file-or-directory-modify-seconds`, and returns an instance of the `date` structure type with the following fields:

- `second` : `0` to `61` (`60` and `61` are for unusual leap-seconds)
- `minute` : `0` to `59`
- `hour` : `0` to `23`
- `day` : `1` to `31`
- `month` : `1` to `12`
- `year` : e.g., `1996`
- `week-day` : `0` (Sunday) to `6` (Saturday)
- `year-day` : `0` to `365` (`364` in non-leap years)
- `dst?` : `#t` (daylight savings time) or `#f`
- `time-zone-offset` : the number of seconds east of GMT for this time zone (e.g., Pacific Standard Time is `-28800`), an exact integer

The value returned by `current-seconds` or `file-or-directory-modify-seconds` is not portable among platforms. Convert a time in seconds using `seconds->date` when portability is needed.

See also section 15.2.7 for additional date utilities.