diff options
| author | Lars Ingebrigtsen | 2019-07-29 14:22:31 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-07-29 14:22:38 +0200 |
| commit | fa04c8b87e50a2e2b0d021958f637be8f475d8bc (patch) | |
| tree | 304b07bc09258970ecf7c4a97fd53e85d4cddfe8 /doc/lispref | |
| parent | 6cfda69d72cb9debefc48d0d95e341d389e7303a (diff) | |
| download | emacs-fa04c8b87e50a2e2b0d021958f637be8f475d8bc.tar.gz emacs-fa04c8b87e50a2e2b0d021958f637be8f475d8bc.zip | |
Add an ISO 8601 parsing library
* doc/lispref/os.texi (Time Parsing): Document it.
* lisp/calendar/iso8601.el: New file.
* test/lisp/calendar/iso8601-tests.el: Test ISO8601 parsing functions.
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/os.texi | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index d397a125738..b3444838d3b 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -1622,6 +1622,19 @@ ISO 8601 string, like ``Fri, 25 Mar 2016 16:24:56 +0100'' or | |||
| 1622 | less well-formed time strings as well. | 1622 | less well-formed time strings as well. |
| 1623 | @end defun | 1623 | @end defun |
| 1624 | 1624 | ||
| 1625 | @vindex ISO 8601 date/time strings | ||
| 1626 | @defun iso8601-parse string | ||
| 1627 | For a more strict function (that will error out upon invalid input), | ||
| 1628 | this function can be used instead. It's able to parse all variants of | ||
| 1629 | the ISO 8601 standard, so in addition to the formats mentioned above, | ||
| 1630 | it also parses things like ``1998W45-3'' (week number) and | ||
| 1631 | ``1998-245'' (ordinal day number). To parse durations, there's | ||
| 1632 | @code{iso8601-parse-duration}, and to parse intervals, there's | ||
| 1633 | @code{iso8601-parse-interval}. All these functions return decoded | ||
| 1634 | time structures, except the final one, which returns three of them | ||
| 1635 | (the start, the end, and the duration). | ||
| 1636 | @end defun | ||
| 1637 | |||
| 1625 | @defun format-time-string format-string &optional time zone | 1638 | @defun format-time-string format-string &optional time zone |
| 1626 | 1639 | ||
| 1627 | This function converts @var{time} (or the current time, if | 1640 | This function converts @var{time} (or the current time, if |