Skip to content

Add missed datetime information #4420

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

Merged
merged 7 commits into from
Aug 12, 2024

Conversation

ligurio
Copy link
Member

@ligurio ligurio commented Aug 8, 2024

ligurio added 2 commits August 7, 2024 16:47
Fixed typo in `input_string` and added default format string
to description of `datetime.parse()`.
@ligurio ligurio marked this pull request as draft August 8, 2024 08:54
@ligurio ligurio force-pushed the ligurio/gh-xxxx-missed-datetime-information branch 3 times, most recently from faa039e to 18cb155 Compare August 8, 2024 15:44
@ligurio ligurio changed the title Missed datetime information Add missed datetime information Aug 8, 2024
@ligurio ligurio force-pushed the ligurio/gh-xxxx-missed-datetime-information branch from 18cb155 to bba7a5c Compare August 9, 2024 10:25
@@ -118,7 +118,7 @@ Functions
- 0

* - sec
- Seconds. Value range: 0 - 60.
- Seconds. Value range: 0 - 60. Leap second is supported, see a section :ref:`leap second <leap-second>`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to section Leap second doesn't work. Andrey, could you help please? @andreyaksenov

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the following anchor before the Leap second section:

.. _leap-second:

Leap second
-----------

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

@@ -263,9 +263,14 @@ Functions
* RFC 3339
* extended `strftime <https://www.freebsd.org/cgi/man.cgi?query=strftime&sektion=3>`__ -- see description of the :ref:`format() <datetime-format>` for details.

By default fields that are not specified are equal to appropriate values in a Unix time.

Leap second is supported, see a section :ref:`leap second <leap-second>`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to section Leap second doesn't work. Andrey, could you help please? @andreyaksenov

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@ligurio ligurio marked this pull request as ready for review August 9, 2024 10:30
@ligurio ligurio requested a review from andreyaksenov August 9, 2024 10:38
Copy link
Contributor

@andreyaksenov andreyaksenov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comments below.


This section describes how ``datetime`` module supports leap seconds:

* Tarantool includes TZDB (also called ``tzdata``) and uses this database
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm correct, we cannot say that TZDB is also called tzdata. While TZDB is a collection of information about the world's time zones, tzdata a specific package that contains the information from the TZDB.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, TZDB is a database with information about timezones and tzdata is a distribution package with other data (like leapsecond file), source code of programs and scripts. I'll fix it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Paragraph was removed.

:ref:`datetime.now() <datetime-now>`, :ref:`datetime:set() <datetime-set>`
accept a table with seconds equal to 60 seconds:

.. code-block:: tarantoolsession
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please add the 4-spaces indent before .. code-block:: tarantoolsession and the entire code block (the same for all code blocks inside lists).
  • I'd remove all the examples after datetime.new({ sec = 60 }). Look a bit excessive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Limitations
-----------

The supported date range is from -5879610-06-22 to +5879611-07-11.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need the examples below? Adding examples for such corner cases is unnecessary in docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll remove it.

Leap second
-----------

Coordinated Universal Time (UTC) is based on International Atomic Time (TAI).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, such detailed info about the leap second looks excessive for Tarantool docs. Can we make a short intro about TZDB in general and the leap seconds in particular, give a link to the external resource, and then jump right to the point (which is how all of these apply to Tarantool)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

for a correct time zones support. Use Lua module :doc:`/reference/reference_lua/tarantool`
to get a used version of ``tzdata``:

Since: :doc:`3.2.0 </release/3.2.0>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since between the description and example looks weird. Ideally, we should describe all the fields in the Module tarantool docs and add the Since info there. As a workaround, let's update the previous sentence like this:

Since :doc:`3.2.0 </release/3.2.0>`, you can use the Lua module ....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated:

--- a/doc/reference/reference_lua/datetime.rst
+++ b/doc/reference/reference_lua/datetime.rst
@@ -1082,10 +1082,9 @@ implement the time zones support properly.
 This section describes how ``datetime`` module supports leap seconds:
 
 *   Tarantool includes TZDB (also called ``tzdata``) and uses this database
-    for a correct time zones support. Use the Lua module :ref:`tarantool <tarantool-module>`
-    to get a used version of ``tzdata``:
-
-    Since: :doc:`3.2.0 </release/3.2.0>`
+    for a correct time zones support. Since :doc:`3.2.0 </release/3.2.0>`,
+    you can use the Lua module :ref:`tarantool <tarantool-module>` to get
+    a used version of ``tzdata``:
 
 ..  code-block:: tarantoolsession
 

but I've removed this paragraph for now, I'll add it in scope of doc request from #10387.

@ligurio ligurio force-pushed the ligurio/gh-xxxx-missed-datetime-information branch from f5c00c1 to 1fe8ca2 Compare August 9, 2024 14:30
@ligurio ligurio requested a review from andreyaksenov August 9, 2024 14:40
@ligurio ligurio force-pushed the ligurio/gh-xxxx-missed-datetime-information branch 2 times, most recently from 8f71c4c to 6bd7ca0 Compare August 11, 2024 15:15
@andreyaksenov andreyaksenov linked an issue Aug 12, 2024 that may be closed by this pull request
Copy link
Contributor

@andreyaksenov andreyaksenov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

the Earth's rotation speed varies in response to climatic and geological events,
and due to this, UTC leap seconds are irregularly spaced and unpredictable.

This section describes how ``datetime`` module supports leap seconds:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This section describes how ``datetime`` module supports leap seconds:
This section describes how the ``datetime`` module supports leap seconds:

Leap second was introduced in commit
"datetime, lua: interval arithmetics" [1].

Fixes #4409

1. tarantool/tarantool@b0463da
@ligurio ligurio force-pushed the ligurio/gh-xxxx-missed-datetime-information branch from 59f8ab9 to ff058d7 Compare August 12, 2024 08:22
ligurio and others added 4 commits August 12, 2024 11:35
Added a section with useful links.
`strptime` is a function, not a library.
@ligurio ligurio force-pushed the ligurio/gh-xxxx-missed-datetime-information branch from ff058d7 to a93eb89 Compare August 12, 2024 08:35
@andreyaksenov andreyaksenov merged commit 70c8f78 into latest Aug 12, 2024
1 check passed
@andreyaksenov andreyaksenov deleted the ligurio/gh-xxxx-missed-datetime-information branch August 12, 2024 08:44
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

Successfully merging this pull request may close these issues.

feedback: datetime.new() | Tarantool
2 participants