Next: External Representation of Time, Previous: File Time, Up: Date and Time
The procedures described in this section convert times from one format to another.
Converts an argument in universal-time format to decoded-time format. The result is in the local time zone or UTC, respectively.
(pp (universal-time->local-decoded-time (get-universal-time))) -| #[decoded-time 21] -| (second 23) -| (minute 57) -| (hour 17) -| (day 29) -| (month 4) -| (year 1999) -| (day-of-week 3) -| (daylight-savings-time 1) -| (zone 5) (pp (universal-time->global-decoded-time (get-universal-time))) -| #[decoded-time 22] -| (second 27) -| (minute 57) -| (hour 21) -| (day 29) -| (month 4) -| (year 1999) -| (day-of-week 3) -| (daylight-savings-time 0) -| (zone 0)
Converts an argument in universal-time format to file-time format.
(universal-time->file-time (get-universal-time)) => 925422988
Converts an argument in universal-time format to a time string. The result is in the local time zone or UTC, respectively.
(universal-time->local-time-string (get-universal-time)) => "Thu, 29 Apr 1999 17:55:31 -0400" (universal-time->global-time-string (get-universal-time)) => "Thu, 29 Apr 1999 21:55:51 +0000"
Converts an argument in decoded-time format to universal-time format.
(decoded-time->universal-time (local-decoded-time)) => 3134411942 (decoded-time->universal-time (global-decoded-time)) => 3134411947
Converts an argument in decoded-time format to file-time format.
(decoded-time->file-time (local-decoded-time)) => 925423191 (decoded-time->file-time (global-decoded-time)) => 925423195
Convert an argument in decoded-time format to a time string.
(decoded-time->string (local-decoded-time)) => "Thu, 29 Apr 1999 18:00:43 -0400" (decoded-time->string (global-decoded-time)) => "Thu, 29 Apr 1999 22:00:46 +0000"
Converts an argument in universal-time format to file-time format.
(file-time->universal-time (file-modification-time "/")) => 3133891907
Converts an argument in file-time format to decoded-time format. The result is in the local time zone or UTC, respectively.
(pp (file-time->local-decoded-time (file-modification-time "/"))) -| #[decoded-time 26] -| (second 47) -| (minute 31) -| (hour 17) -| (day 23) -| (month 4) -| (year 1999) -| (day-of-week 4) -| (daylight-savings-time 1) -| (zone 5) (pp (file-time->global-decoded-time (file-modification-time "/"))) -| #[decoded-time 27] -| (second 47) -| (minute 31) -| (hour 21) -| (day 23) -| (month 4) -| (year 1999) -| (day-of-week 4) -| (daylight-savings-time 0) -| (zone 0)
Converts an argument in file-time format to a time string. The result is in the local time zone or UTC, respectively.
(file-time->local-time-string (file-modification-time "/")) => "Fri, 23 Apr 1999 17:31:47 -0400" (file-time->global-time-string (file-modification-time "/")) => "Fri, 23 Apr 1999 21:31:47 +0000"
Converts a time-string argument to universal-time format.
(string->universal-time "Fri, 23 Apr 1999 21:31:47 +0000") => 3133888307 (string->universal-time "Fri, 23 Apr 1999 17:31:47 -0400") => 3133888307
Converts a time-string argument to decoded-time format.
(pp (string->decoded-time "Fri, 23 Apr 1999 17:31:47 -0400")) -| #[decoded-time 30] -| (second 47) -| (minute 31) -| (hour 17) -| (day 23) -| (month 4) -| (year 1999) -| (day-of-week 4) -| (daylight-savings-time 0) -| (zone 4)