All Manuals > LispWorks® User Guide and Reference Manual > 32 The COMM Package

generalized-time-p

make-generalized-time

generalized-time-pprint

generalized-time-string

parse-printed-generalized-time Functions

Summary

Various operations on generalized-time objects.

Package

comm

Signatures

generalized-time-p object => boolean

make-generalized-time &key universal-time microseconds gmtoffset => generalized-time

generalized-time-pprint generalized-time stream

generalized-time-string generalized-time => printed-time

parse-printed-generalized-time printed-time &optional start => generalized-time-or-nil

Arguments
object
Any Lisp object.
universal-time
An integer.
microseconds
An integer or nil.
gmtoffset
An integer, :gmt or nil.
generalized-time
stream
A stream.
printed-time
A string.
start
An integer.
Values
boolean
nil or t.
generalized-time
printed-time
A string.
generalized-time-or-nil
A generalized-time or nil.
Description

The function generalized-time-p is a predicate, which returns t if object is of type generalized-time and otherwise returns nil.

The function make-generalized-time constructs a generalized-time object. universal-time must be an integer, specifying universal time in the Common Lisp sense. microseconds must be an integer or nil. gmtoffset must be an integer specifying the offset from GMT in seconds, :gmt or nil.

The function generalized-time-pprint prints generalized-time to stream in a human readable format. The format is:

yyyy mon dd hh:mm:ss[.fff|.gggggg][*hhmm| GMT]

The function generalized-time-string returns a string containing the printed representation of generalized-time as described above.

The function parse-printed-generalized-time parses its argument printed-time, starting from start (which defaults to 0). It expects to find the format that is described above, and does not check that the end of that format is the end of the string. If parse-printed-generalized-time fails to read the time part, that is it doesn't find a match to the pattern above up to the second 's', it returns nil. Otherwise, it creates a generalized-time with this time as its universal time and nil for microseconds and gmtoffset. It then tries to read the microseconds and gmtoffset and set them in the generalized-time before returning it.


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:26