Next: File Time, Previous: Universal Time, Up: Date and Time
Objects representing standard time components, such as seconds and
minutes, are required to be exact non-negative integers. Seconds and
minutes must be inclusively between 0
and 59
; hours
between 0
and 23
; days between 1
and 31
;
months between 1
and 12
; years are represented in
“four-digit” form, in which 1999 is represented as 1999
—
not 99
.
Return the current time in decoded format. The decoded time is represented in the local time zone.
(pp (local-decoded-time)) -| #[decoded-time 76] -| (second 2) -| (minute 12) -| (hour 11) -| (day 27) -| (month 4) -| (year 1999) -| (day-of-week 1) -| (daylight-savings-time 1) -| (zone 5)
Return the current time in decoded format. The decoded time is represented in UTC.
(pp (global-decoded-time)) -| #[decoded-time 77] -| (second 8) -| (minute 12) -| (hour 15) -| (day 27) -| (month 4) -| (year 1999) -| (day-of-week 1) -| (daylight-savings-time 0) -| (zone 0)
Return a new decoded-time object representing the given time. The arguments must be valid components according to the above rules, and must form a valid date.
If zone is not supplied or is
#f
, the resulting decoded time will be represented in the local time zone. Otherwise, zone must be a valid time zone, and the result will be represented in that zone.Warning: because this procedure depends on the operating system's runtime library, it is not capable of representing all dates. In particular, on most unix systems, it is not possible to encode dates that occur prior to midnight, January 1, 1970 UTC. Attempting to do this will signal an error.
(pp (make-decoded-time 0 9 11 26 3 1999)) -| #[decoded-time 19] -| (second 0) -| (minute 9) -| (hour 11) -| (day 26) -| (month 3) -| (year 1999) -| (day-of-week 4) -| (daylight-savings-time 0) -| (zone 5) (pp (make-decoded-time 0 9 11 26 3 1999 3)) -| #[decoded-time 80] -| (second 0) -| (minute 9) -| (hour 11) -| (day 26) -| (month 3) -| (year 1999) -| (day-of-week 4) -| (daylight-savings-time 0) -| (zone 3)
Return the corresponding component of decoded-time.
(decoded-time/second (local-decoded-time)) => 17 (decoded-time/year (local-decoded-time)) => 1999 (decoded-time/day (local-decoded-time)) => 26
Return the day of the week on which decoded-time falls, encoded as an exact integer between
0
(Monday) and6
(Sunday), inclusive.(decoded-time/day-of-week (local-decoded-time)) => 4
Return
#t
if decoded-time is represented using daylight savings time. Otherwise return#f
.(decoded-time/daylight-savings-time? (local-decoded-time)) => #f
Return the time zone in which decoded-time is represented. This is an exact rational number between
-24
and+24
inclusive, that when multiplied by3600
is an integer. The value is the number of hours west of UTC.(decoded-time/zone (local-decoded-time)) => 5