Commits


datetime: support tz field in :totable() `datetime` module has a function `:totable()` that converts the information from a datetime object into the table format. The commit 43e10ed34949 ("build, lua: built-in module datetime") added `tzoffset` field to the datetime object and to table produced by `:totable()`. The commit 9ee45289e012 ("datetime: datetime.TZ array") added fields `tz` and `tzindex` to the datetime object, but not to the table produced by `:totable()`. The patch fixes that. Note, `tzindex` is not added, because it is an internal field. ``` tarantool> datetime.parse('2004-12-01T00:00 Europe/Moscow'):totable() --- - tz: Europe/Moscow sec: 0 min: 0 yday: 336 day: 1 nsec: 0 isdst: false wday: 4 tzoffset: 180 month: 12 year: 2004 hour: 0 ... ``` Fixes #10331 Follows up #6751 @TarantoolBot document Title: Support of tz field in :totable() In addition to the `tzoffset` in a table produced by `:totable` we added `tz` field. ``` tarantool> datetime.parse('2004-12-01T00:00 Europe/Moscow'):totable() --- - tz: Europe/Moscow sec: 0 min: 0 yday: 336 day: 1 nsec: 0 isdst: false wday: 4 tzoffset: 180 month: 12 year: 2004 hour: 0 ... ```


datetime: remove unused function datetime_gmtoff The function `datetime_gmtoff()` has been introduced in commit aec6fbac1f22 ("datetime: implement date.isdst") for a function `datetime_increment_by()`. In commit 6ca072853034 ("datetime: fix interval arithmetic for DST") the function `datetime_increment_by()` has been updated and call of the function `datetime_gmtoff()` was removed. `datetime_gmtoff` is dead code now. The patch removes `datetime_gmtoff()`. NO_CHANGELOG=codehealth NO_DOC=codehealth NO_TEST=codehealth


datetime: fix typos The patch fixes a number of typos in datetime source code. NO_CHANGELOG=codehealth NO_DOC=codehealth NO_TEST=codehealth


datetime: fix values of unspecified fields in dt.parse() datetime object can be created using `datetime.new()` and `datetime.parse()`. `datetime.new()` sets values of unspecified fields to appropriate values of fields in a Unix time (00:00:00 UTC on 1 January 1971, Thursday), see commit 43e10ed34949 ("build, lua: built-in module datetime"): ``` tarantool> datetime.new() --- - 1970-01-01T00:00:00Z ... tarantool> datetime.new():totable() --- - sec: 0 min: 0 yday: 1 day: 1 nsec: 0 isdst: false wday: 5 tzoffset: 0 month: 1 year: 1970 hour: 0 ``` The function `datetime.parse` converts an input string with the date and time information into a datetime object. When fields are not specified in a input string their values becomes undefined: ``` tarantool> dt.parse('01:01:01', {format ='%H:%M:%S'}):totable() --- - sec: -59 min: -58 yday: 366 day: 31 nsec: 0 isdst: false wday: 1 tzoffset: 0 month: 12 year: 0 hour: -22 ... tarantool> ``` The commit fixes aforementioned behaviour of `datetime.parse()` by setting values for fields not specified by user to values of appropriate fields of Unix time. NO_DOC=bugfix Fixes #8588


doc: update config storage doc Update `config.storage` README to include `tarantool-ee` changes from this PR [1]. Note that these changes are for EE only. [1] https://github.com/tarantool/tarantool-ee/pull/857 Part of https://github.com/tarantool/tarantool-ee/issues/849 NO_DOC=doc_changes NO_TEST=doc_changes NO_CHANGELOG=doc_changes