The cl-date-time-parser Reference Manual

This is the cl-date-time-parser Reference Manual, version 0.1.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:49:45 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-date-time-parser

Parse date-time-string, and return (values universal-time fraction).
Parsable date-time-format: ISO8601, W3CDTF, RFC3339, RFC822, RFC2822, RFC5322, asctime, RFC850, RFC1036.

Author

Takaya OCHIAI <>

License

MIT License

Version

0.1.3

Dependencies
  • alexandria (system).
  • split-sequence (system).
  • anaphora (system).
  • cl-ppcre (system).
  • local-time (system).
  • parse-float (system).
Source

cl-date-time-parser.asd.

Child Component

date-time-parser.lisp (file).


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 cl-date-time-parser/cl-date-time-parser.asd

Source

cl-date-time-parser.asd.

Parent Component

cl-date-time-parser (system).

ASDF Systems

cl-date-time-parser.


3.1.2 cl-date-time-parser/date-time-parser.lisp

Source

cl-date-time-parser.asd.

Parent Component

cl-date-time-parser (system).

Packages

cl-date-time-parser.

Public Interface

parse-date-time (function).

Internals

4 Packages

Packages are listed by definition order.


4.1 cl-date-time-parser

Source

date-time-parser.lisp.

Nickname

date-time-parser

Use List

common-lisp.

Public Interface

parse-date-time (function).

Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: parse-date-time (date-time-string)

Parse DATE-TIME-STRING, and return (values UNIVERSAL-TIME FRACTION). DATE-TIME-STRING must represent the date-time after 1900-01-01T00:00:00Z.

Parsable Formats:
* RFC822 Genus: RFC822 (RFC1123, RFC2822, RFC5322), RFC850 (RFC1036) and asctime. * ISO8601 Genus: ISO 8601 (:1988, :2000 and :2004. except for no-year format), W3CDTF, RFC3339.
* Broken format: The above formats with little broken.

Examples:
* (parse-date-time "Thu, 23 Jul 2013 19:42:23 JST")
=> 3583564943, 0

* (parse-date-time "2013-07-23T19:42:23+09:00")
=> 3583564943, 0

* (parse-date-time "23 Jul 13 19:42:23 +0900")
=> 3583564943, 0

* (parse-date-time "Thu Jul 23 19:42:23 JST 2013")
=> 3583564943, 0

* (parse-date-time "2013-07-23T19:42:23.45Z")
=> 3583597343, 0.45

For more examples, see Eval-Test in date-time-parser.lisp

Package

cl-date-time-parser.

Source

date-time-parser.lisp.


5.2 Internals


5.2.1 Constants

Constant: +day-secs+
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Constant: +hour-secs+
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Constant: +minuite-secs+
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Constant: +second+
Package

cl-date-time-parser.

Source

date-time-parser.lisp.


5.2.2 Special variables

Special Variable: *day-of-week*
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Special Variable: *features-tmp*
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Special Variable: *month-ht-in-leap-year*
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Special Variable: *month-ht-in-normal-year*
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Special Variable: *month-vec-in-leap-year*
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Special Variable: *month-vec-in-normal-year*
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Special Variable: *tz-abbrev-to-offest*
Package

cl-date-time-parser.

Source

date-time-parser.lisp.


5.2.3 Ordinary functions

Function: calc-offset (tz-abbrev)

Return offset for the time-zone-abbrev. If not find offset, return NIL.

Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Function: get-offset (tz-abbrev)
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Function: leap-year-p (year)

Return T if YEAR is a leap year, otherwise NIL. c.f. RFC3339, (Appendix C. Leap Years)

Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Function: month-to-ut (month leap-year?)
Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Function: parse-iso8601-genus (date-time-string)

Parse DATE-TIME-STRING with ISO8601, W3CDTF or RFC3339 format, and return (values UNIVERSAL-TIME FRACTION).

Reference:
* ISO8601:1988, 2000, 2004
– http://www.iso.org/iso/home/standards/iso8601.htm * W3CDTF – http://www.w3.org/TR/1998/NOTE-datetime-19980827 * RFC3339 – http://tools.ietf.org/html/rfc3339

Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Function: parse-rfc822-genus (date-time-string)

Parse DATE-TIME-STRING with RFC822 (RFC1123, RFC2822, RFC5322), RFC850 (RFC1036) or asctime format, and return
(values UNIVERSAL-TIME FRACTION).

Reference:
* RFC822 – http://tools.ietf.org/html/rfc822
* RFC2822 – http://tools.ietf.org/html/rfc2822
* RFC5322 – http://tools.ietf.org/html/rfc5322
* RFC850 – http://tools.ietf.org/html/rfc850
* RFC1036 – http://tools.ietf.org/html/rfc1036
* asctime – http://en.cppreference.com/w/c/chrono/asctime

Package

cl-date-time-parser.

Source

date-time-parser.lisp.

Function: year-to-ut (year)
Package

cl-date-time-parser.

Source

date-time-parser.lisp.


Appendix A Indexes


A.1 Concepts