Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
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 Wed Jun 15 03:38:08 2022 GMT+0.
Next: Systems, Previous: The cl-date-time-parser Reference Manual, Up: The cl-date-time-parser Reference Manual [Contents][Index]
Last modified: 2014-05-18 14:39:27 tkych
version 0.1.03 (beta)
In general, an implementation should be conservative in its sending behavior, and liberal in its receiving behavior. RFC791: Internet Protocol
There are a lot of formats to specify the date and time on the Web. For example:
The goal of cl-date-time-parser is to hide the difference between date-time formats, and enable to manage date and time as the one date-time format (Universal Time).
Function parse-date-time
parses date-time-string, and return universal-time and fraction.
Parsable date-time formats are:
In addition, parse-date-time
can liberally parse the above formats with little broken.
(ql:quickload :cl-date-time-parser)
git clone https://github.com/tkych/cl-date-time-parser
(push #p"/path-to-cl-date-time-parser/cl-date-time-parser/" asdf:*central-registry*)
(ql:quickload :cl-date-time-parser)
or (asdf:load-system :cl-date-time-parser)
(parse-date-time "Thu, 23 Jul 2013 19:42:23 GMT") ;RFC 1123
=> 3583597343, 0
(parse-date-time "Thu Jul 23 19:42:23 2013") ;asctime
=> 3583597343, 0
(parse-date-time "Thursday, 23-Jul-13 19:42:23 GMT") ;RFC 1036
=> 3583597343, 0
(parse-date-time "2013-07-23T19:42:23Z") ;RFC 3339
=> 3583597343, 0
(parse-date-time "20130723T194223Z") ;ISO 8601
=> 3583597343, 0
(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
(parse-date-time "2013-01-01")
=> 3565987200, 0
(parse-date-time "2013")
=> 3565987200, 0
(parse-date-time "1 Jan 13")
=> 3565987200, 0
(parse-date-time "2003-12-31T25:14:55Z") ;broken hours
=> 3281908495, 0
(parse-date-time "2004-01-01T01:14:55Z")
=> 3281908495, 0
(parse-date-time "2003-12-31T10:61:55Z") ;broken minuits
=> 3281857315, 0
(parse-date-time "2003-12-31T11:01:55Z")
=> 3281857315, 0
(parse-date-time "2003-12-31T10:14:61Z") ;broken seconds
=> 3281854501, 0
(parse-date-time "2003-12-31T10:15:01Z")
=> 3281854501, 0
(parse-date-time ";3-12-31T10:15:01Z") ;broken two-digit-years c.f. rfc3339, 3.
=> 3597473701, 0
(parse-date-time "2013-12-31T10:15:01Z")
=> 3597473701, 0
For further examples, please see Eval-Test in date-time-parser.lisp
Parse date-time-string, and return universal-time and fraction. date-time-string must represent the date-time after 1900-01-01T00:00:00Z.
Parsable Formats:
RFC822 (Internet Message Format) Genus:
ISO8601 (Timestamp) Genus:
Takaya OCHIAI <#.(reverse "moc.liamg@lper.hcykt")>
MIT License
Copyright (C) 2013 Takaya OCHIAI
Next: Files, Previous: Introduction, Up: The cl-date-time-parser Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Parse date-time-string, and return (values universal-time fraction).
Parsable date-time-format: ISO8601, W3CDTF, RFC3339, RFC822, RFC2822, RFC5322, asctime, RFC850, RFC1036.
Takaya OCHIAI <tkych.repl@gmail.com>
MIT License
0.1.3
date-time-parser.lisp (file).
Next: Packages, Previous: Systems, Up: The cl-date-time-parser Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: cl-date-time-parser/date-time-parser.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
cl-date-time-parser (system).
Previous: cl-date-time-parser/cl-date-time-parser.asd, Up: Lisp [Contents][Index]
cl-date-time-parser (system).
parse-date-time (function).
Next: Definitions, Previous: Files, Up: The cl-date-time-parser Reference Manual [Contents][Index]
Packages are listed by definition order.
date-time-parser
common-lisp.
parse-date-time (function).
Next: Indexes, Previous: Packages, Up: The cl-date-time-parser Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Previous: Public Interface, Up: Public Interface [Contents][Index]
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
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Special variables, Previous: Internals, Up: Internals [Contents][Index]
Next: Ordinary functions, Previous: Constants, Up: Internals [Contents][Index]
Previous: Special variables, Up: Internals [Contents][Index]
Return offset for the time-zone-abbrev. If not find offset, return NIL.
Return T if YEAR is a leap year, otherwise NIL. c.f. RFC3339, (Appendix C. Leap Years)
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
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
Previous: Definitions, Up: The cl-date-time-parser Reference Manual [Contents][Index]
Jump to: | C F G L M P Y |
---|
Jump to: | C F G L M P Y |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | *
+
C S |
---|
Jump to: | *
+
C S |
---|
Jump to: | C D F P S |
---|
Jump to: | C D F P S |
---|