You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/reference/reference_lua/datetime.rst
+81-4Lines changed: 81 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ Functions
118
118
- 0
119
119
120
120
* - sec
121
-
- Seconds. Value range: 0 - 60.
121
+
- Seconds. Value range: 0 - 60. A leap second is supported, see a section :ref:`leap second <leap-second>`.
122
122
- number
123
123
- 0
124
124
@@ -263,9 +263,14 @@ Functions
263
263
* RFC 3339
264
264
* extended `strftime <https://www.freebsd.org/cgi/man.cgi?query=strftime&sektion=3>`__ -- see description of the :ref:`format() <datetime-format>` for details.
265
265
266
+
By default fields that are not specified are equal to appropriate values in a Unix time.
267
+
268
+
Leap second is supported, see a section :ref:`leap second <leap-second>`.
269
+
266
270
:param string input_string: string with the date and time information.
267
-
:param string format: indicator of the input_sting format. Possible values: 'iso8601', 'rfc3339', or ``strptime``-like format string.
268
-
If no value is set, the default formatting is used.
271
+
:param string format: indicator of the ``input_string`` format.
272
+
Possible values: 'iso8601', 'rfc3339', or ``strptime``-like format string.
273
+
If no value is set, the default formatting is used (``"%F %T %Z"``).
269
274
:param number tzoffset: time zone offset from UTC, in minutes.
Convert the standard ``datetime`` object presentation into a formatted string.
587
-
The conversion specifications are the same as in the `strftime <https://www.freebsd.org/cgi/man.cgi?query=strftime&sektion=3>`__ library.
611
+
The conversion specifications are the same as in the `strftime <https://www.freebsd.org/cgi/man.cgi?query=strftime&sektion=3>`__ function.
588
612
Additional specification for nanoseconds is `%f` which also allows a modifier to control the output precision of fractional part: `%5f` (see the example below).
589
613
If no arguments are set for the method, the default conversions are used: `'%FT%T.%f%z'` (see the example below).
590
614
@@ -1012,3 +1036,56 @@ Support for relational operators for ``interval`` objects has been added since :
1012
1036
---
1013
1037
- true
1014
1038
...
1039
+
1040
+
.. _leap-second:
1041
+
1042
+
Leap second
1043
+
-----------
1044
+
1045
+
`Leap seconds <https://en.wikipedia.org/wiki/Leap_second>`__ are a periodic
1046
+
one-second adjustment of Coordinated Universal Time(UTC) in order to keep
1047
+
a system's time of day close to the mean solar time. However,
1048
+
the Earth's rotation speed varies in response to climatic and geological events,
1049
+
and due to this, UTC leap seconds are irregularly spaced and unpredictable.
1050
+
1051
+
Tarantool includes the `Time Zone Database <https://www.iana.org/time-zones>`__
1052
+
that beside the time zone description files also contains a leapseconds file.
1053
+
1054
+
This section describes how the ``datetime`` module supports leap seconds:
1055
+
1056
+
* The function :ref:`datetime.parse() <datetime-parse>` correctly parses
0 commit comments