Next: Runtime Environment, Previous: User Information, Up: POSIX
Return the number of seconds since 1970-01-01 00:00:00 UTC, excluding leap seconds.
Return a pair containing the number of seconds and microseconds since 1970-01-01 00:00:00 UTC, excluding leap seconds. Note: whether true microsecond resolution is available depends on the operating system.
The following procedures either accept an object representing a broken down time and return a selected component, or accept an object representing a broken down time and a value and set the component to the value. The numbers in parentheses give the usual range.
Year (70-), the year minus 1900.
Day of the week (0-6) with Sunday represented as 0.
Day of the year (0-364, 365 in leap years).
Daylight saving indicator (0 for “no”, greater than 0 for “yes”, less than 0 for “unknown”).
Time zone offset in seconds west of UTC (-46800 to 43200).
Time zone label (a string), not necessarily unique.
Return an object representing the broken down components of time, an integer like the one returned by
current-time
. The time zone for the calculation is optionally specified by zone (a string), otherwise the TZ environment variable or the system default is used.
Return an object representing the broken down components of time, an integer like the one returned by
current-time
. The values are calculated for UTC.
For a broken down time object sbd-time, return a pair the
car
of which is an integer time likecurrent-time
, and thecdr
of which is a new broken down time with normalized fields.zone is a timezone string, or the default is the TZ environment variable or the system default (see Specifying the Time Zone with TZ). sbd-time is taken to be in that zone.
The following fields of sbd-time are used:
tm:year
,tm:mon
,tm:mday
,tm:hour
,tm:min
,tm:sec
,tm:isdst
. The values can be outside their usual ranges. For exampletm:hour
normally goes up to 23, but a value say 33 would mean 9 the following day.
tm:isdst
in sbd-time says whether the time given is with daylight savings or not. This is ignored if zone doesn't have any daylight savings adjustment amount.The broken down time in the return normalizes the values of sbd-time by bringing them into their usual ranges, and using the actual daylight savings rule for that time in zone (which may differ from what sbd-time had). The easiest way to think of this is that sbd-time plus zone converts to the integer UTC time, then a
localtime
is applied to get the normal presentation of that time, in zone.
Initialize the timezone from the TZ environment variable or the system default. It's not usually necessary to call this procedure since it's done automatically by other procedures that depend on the timezone.
Return a string which is broken-down time structure tm formatted according to the given format string.
format contains field specifications introduced by a `%' character. See Formatting Calendar Time, or `man 3 strftime', for the available formatting.
(strftime "%c" (localtime (current-time))) => "Mon Mar 11 20:17:43 2002"If
setlocale
has been called (see Locales), month and day names are from the current locale and in the locale character set.Note that `%Z' might print the
tm:zone
in tm or it might print just the current zone (tzset
above). A GNU system printstm:zone
, a strict C99 system like NetBSD prints the current zone. Perhaps in the future Guile will try to gettm:zone
used always.
Performs the reverse action to
strftime
, parsing string according to the specification supplied in template. The interpretation of month and day names is dependent on the current locale. The value returned is a pair. The CAR has an object with time components in the form returned bylocaltime
orgmtime
, but the time zone components are not usefully set. The CDR reports the number of characters from string which were used for the conversion.
The value of this variable is the number of time units per second reported by the following procedures.
Return an object with information about real and processor time. The following procedures accept such an object as an argument and return a selected component:
— Scheme Procedure: tms:clock tms
The current real time, expressed as time units relative to an arbitrary base.
— Scheme Procedure: tms:stime tms
The CPU time units used by the system on behalf of the calling process.