This section explains how to determine the current time and the time zone.
substring
to extract pieces of it. It is wise to count the
characters from the beginning of the string rather than from the end, as
additional information may some day be added at the end.
The argument time-value, if given, specifies a time to format
instead of the current time. The argument should be a list whose first
two elements are integers. Thus, you can use times obtained from
current-time
(see below) and from file-attributes
(see section Other Information about Files).
(current-time-string) => "Wed Oct 14 22:21:05 1987"
(high low microsec)
. The integers
high and low combine to give the number of seconds since
0:00 January 1, 1970, which is
The third element, microsec, gives the microseconds since the start of the current second (or 0 for systems that return time only on the resolution of a second).
The first two elements can be compared with file time values such as you
get with the function file-attributes
. See section Other Information about Files.
The value has the form (offset name)
. Here
offset is an integer giving the number of seconds ahead of UTC
(east of Greenwich). A negative value means west of Greenwich. The
second element, name is a string giving the name of the time
zone. Both elements change when daylight savings time begins or ends;
if the user has specified a time zone that does not use a seasonal time
adjustment, then the value is constant through time.
If the operating system doesn't supply all the information necessary to
compute the value, both elements of the list are nil
.
The argument time-value, if given, specifies a time to analyze
instead of the current time. The argument should be a cons cell
containing two integers, or a list whose first two elements are
integers. Thus, you can use times obtained from current-time
(see above) and from file-attributes
(see section Other Information about Files).
Go to the first, previous, next, last section, table of contents.