Skip to content
Snippets Groups Projects
Commit 9bc059bb authored by Timur Safin's avatar Timur Safin Committed by Kirill Yukhin
Browse files

datetime: changelog updated

We have introduced new parse functions, and modified relevant
external submodules to support huge years formats.

@TarantoolBot document
Title: Document datetime.parse

We support relaxed ISO-8601/RFC339 date formats. Consider RFC-3339 as a
profile of a strict ISO-8601, not major extension. We use c-dt, which is
ISO-8601 conformant in such way that we accept superset of ISO-8601
strings, with a few reasonable extensions.

Few examples for further clarification:

Years
=====

| Basic | Extended | ... | ISO-8601? |
|-------|-----------|-----|-----------|
| `20121224` | `2012-12-24` | Calendar date | yes |
| `2012359` | `2012-359` | Ordinal date | yes |
| `2012W521` | `2012-W52-1` | Week date | yes |
| `2012Q485` | `2012-Q4-85` | Quarter date |  |

Modified [`c-dt` parser supports extended years](tarantool/c-dt#1)
values, which are outside of standard [0001 .. 9999] range

| Tarantool extended values |   |
|------------------------------|---|
| `0000-01-01` | `-0001-12-31` |
| `5879611-07-11` | `-5879610-06-22` |

Time
====

| Basic | Extended |
|-------|-----------|
| `T12` | N/A |
| `T1230` | `T12:30` |
| `T123045` | `T12:30:45` |
| `T123045.123456789` | `T12:30:45.123456789` |
| `T123045,123456789` | `T12:30:45,123456789` |

The time designator `T` may be omitted. This is exactly how RFC3339 is
different to strict ISO-8601.

Timezone
========

We do not (yet) support names for standard time-zones (like `MSK`, or
`EST`, or `America/New_York` or whatever) we only support numeric offsets
at the moment.

In a form

| Basic | Extended |
|-------|-----------|
| `Z` | N/A |
| `+hh` | N/A |
| `-hhmm` | `-hh:mm` |
| `GMT+h` |  |
| `GMT-hhmm` |  |
| `GMT+h:mm | `GMT+hh:mm` |
| `UTC-h:mm` | `UTC-hh:mm` |

And relaxed ISO-8601 format is compositions of all relaxed subformats (i.e.
date, time, and timezone) putting them together as:

> {relaxed-date} ( `[Tt ]` {relaxed-time} ( `' '` {lenient-time-zone})? )?

NO_TEST=documentaton update
Closes #6731
parent 5511dda7
No related branches found
No related tags found
No related merge requests found
......@@ -2,3 +2,7 @@
* Add a new builtin module `datetime.lua` which allows to operate
timestamps and intervals values (gh-5941);
* Parse method to allow converting string literals in extended iso-8601
or rfc3339 formats (gh-6731);
* The range of supported years has been extended in all parsers to cover
fully -5879610-06-22..5879611-07-11 (gh-6731).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment