Skip to content

Conversation

@tmr-g
Copy link
Contributor

@tmr-g tmr-g commented Nov 28, 2025

Пока ограниченно поддерживаются 60-е секунды как начало следующей минуты.

Дополнительные секунды полностью не поддерживаются.

См:

datetime.new({ year = 1998, month = 12, day = 31, hour = 23, min = 59, sec = 60})
---
- 1999-01-01T00:00:00Z
  • 60-я секунда не поддерживается:
datetime.parse('1998-12-31T23:59:60Z', {format='rfc3339'})
---
- error: 'builtin/datetime.lua:885: could not parse ''1998-12-31T23:59:60Z'''

@tmr-g tmr-g requested a review from lenkis December 5, 2025 17:18
@lenkis
Copy link
Contributor

lenkis commented Dec 9, 2025

Предлагаю в конце раздела про leap seconds еще явным образом указать те варианты, которые не работают. Например (со строки 1124):

Meanwhile the following cases are NOT supported by the ``datetime`` module:

*  The :ref:`datetime.new() <datetime-new>` function applies 60 seconds in the ``sec`` key
   and doesn't show them explicitly in the result:

    ..  code-block:: tarantoolsession

        datetime.new({ year = 1998, month = 12, day = 31, hour = 23, min = 59, sec = 60})
        ---
        - 1999-01-01T00:00:00Z

*  The function :ref:`datetime.parse() <datetime-parse>` produces an error when parsing an input string
   with 60 seconds and a format that supports leap seconds ('rfc3339', 'iso8601'):

    ..  code-block:: tarantoolsession

        datetime.parse('1998-12-31T23:59:60Z', {format='rfc3339'})
        ---
        - error: 'builtin/datetime.lua:885: could not parse ''1998-12-31T23:59:60Z'''

@tmr-g tmr-g force-pushed the datetime-leap-sec-refine branch from a138601 to e6c035a Compare December 9, 2025 16:58
@lenkis lenkis merged commit 353f60c into tarantool:latest Dec 9, 2025
1 check failed
@tmr-g tmr-g deleted the datetime-leap-sec-refine branch December 9, 2025 20:25
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.

2 participants