Skip to content

Document datetime.parse #2792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TarantoolBot opened this issue Apr 4, 2022 · 1 comment
Closed

Document datetime.parse #2792

TarantoolBot opened this issue Apr 4, 2022 · 1 comment

Comments

@TarantoolBot
Copy link
Collaborator

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
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
Requested by @tsafin in tarantool/tarantool@9bc059b.

@patiencedaur
Copy link
Contributor

Duplicate of #2576. Information copied to the tracked issue. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants