Functions are provided to allow parsing strings containing time information and printing time in various formats are available.
:error-on-mismatch :default-seconds :default-minutes :default-hours :default-day :default-month :default-year :default-zone :default-weekday ¶parse-time accepts a string containing a time (e.g.,
"Jan 12, 1952") and returns the universal time if it is
successful. If it is unsuccessful and the keyword argument
:error-on-mismatch is non-nil, it signals an error.
Otherwise it returns nil. The other keyword arguments have the
following meaning:
:default-secondsspecifies the default value for the seconds value if one is not provided by time-string. The default value is 0.
:default-minutesspecifies the default value for the minutes value if one is not provided by time-string. The default value is 0.
:default-hoursspecifies the default value for the hours value if one is not provided by time-string. The default value is 0.
:default-dayspecifies the default value for the day value if one is not provided by time-string. The default value is the current day.
:default-monthspecifies the default value for the month value if one is not provided by time-string. The default value is the current month.
:default-yearspecifies the default value for the year value if one is not provided by time-string. The default value is the current year.
:default-zonespecifies the default value for the time zone value if one is not provided by time-string. The default value is the current time zone.
:default-weekdayspecifies the default value for the day of the week if one is not provided by time-string. The default value is the current day of the week.
Any of the above keywords can be given the value :current which
means to use the current value as determined by a call to the
operating system.
:timezone :style :date-first :print-seconds :print-meridian :print-timezone :print-weekday ¶:timezone :style :date-first :print-seconds :print-meridian :print-timezone :print-weekday ¶format-universal-time formats the time specified by
universal-time. format-decoded-time formats the time
specified by seconds, minutes, hours, day,
month, and year. Dest is any destination
accepted by the format function. The keyword arguments have
the following meaning:
:timezoneis an integer specifying the hours west of
Greenwich. :timezone defaults to the current time zone.
:stylespecifies the style to use in formatting the time. The legal values are:
:shortspecifies to use a numeric date.
:longspecifies to format months and weekdays as words instead of numbers.
:abbreviatedis similar to long except the words are abbreviated.
:governmentis similar to abbreviated, except the date is of the form “day month year” instead of “month day, year”.
:date-firstif non-nil (default) will place the
date first. Otherwise, the time is placed first.
:print-secondsif non-nil (default) will format
the seconds as part of the time. Otherwise, the seconds will be
omitted.
:print-meridianif non-nil (default) will format
“AM” or “PM” as part of the time. Otherwise, the “AM” or
“PM” will be omitted.
:print-timezoneif non-nil (default) will format
the time zone as part of the time. Otherwise, the time zone will
be omitted.
:print-weekdayif non-nil (default) will format
the weekday as part of date. Otherwise, the weekday will be
omitted.