Various operations on generalized-time objects.

comm

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`

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. |

boolean | `nil` or `t` . |

generalized-time | |

printed-time |
A string. |

generalized-time-or-nil | |

A generalized-time or `nil` . |

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]

- Spaces, colons and dots stand for themselves.
- Items inside square brackets are optional, and the | specifies alternatives.
`yyyy`is the year in four digits.`mon`is the month, as capitalized three letters.`dd`,`hh`,`mm`and`ss`are the day, hour, minute and second as two digits.- If
`generalized-time`has a non-nil`microseconds`then a dot is output followed by`fff`if`microseconds`that is divisible by 1000, and is three digits specifying`microseconds`truncated by 1000 (that is milliseconds), or`gggggg`if`microseconds`is not divisible by 1000, and is the microseconds in 6 digits. - *
`hhmm`is output if`generalized-time`has integer`gmtoffset`. The output is the sign, followed by two digits specifying the hours (that is`gmtoffset`truncated by 3600), followed by two digits specifying the minute (that is the remainder of`gmtoffset`from 3600 truncated by 60). Note that the printed representation cannot display the seconds of the timezone. - GMT is output if
`generalized-time`has`gmtoffset``:gmt`

. - No timezone information is output if
`generalized-time`has`gmtoffset``nil`

.

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*