datetime: handle timezone names in tz
Since recently we partially support timezone names (i.e. as abbreviations) so we may modify tz attribute support for datetime constructors or :set() operations. Closes #7076 Relates to #7007 @TarantoolBot document Title: datetime tz attribute Now `tz` attribute is properly handled in datetime value constructors or `:set{}` method modifiers. ``` tarantool> T = date.new{year = 1980, tz = 'MSK'} --- ... tarantool> T.tzoffset --- - 180 ... tarantool> T.tz --- - MSK ... tarantool> T = date.new{year = 1980, tzoffset = 180} --- ... tarantool> T.tzindex --- - 0 ... tarantool> T.tz --- - ... tarantool> T.tzoffset --- - 180 ... tarantool> T:set{tz = 'MSK'} --- ... tarantool> T.tz --- - MSK ... ```
Showing
- changelogs/unreleased/gh-7076-tz-attributes.md 22 additions, 0 deletionschangelogs/unreleased/gh-7076-tz-attributes.md
- extra/exports 1 addition, 0 deletionsextra/exports
- src/lib/core/datetime.c 17 additions, 0 deletionssrc/lib/core/datetime.c
- src/lib/core/datetime.h 15 additions, 0 deletionssrc/lib/core/datetime.h
- src/lib/tzcode/strftime.c 5 additions, 2 deletionssrc/lib/tzcode/strftime.c
- src/lua/datetime.lua 56 additions, 19 deletionssrc/lua/datetime.lua
- src/lua/tnt_datetime.c 7 additions, 0 deletionssrc/lua/tnt_datetime.c
- test/app-tap/datetime.test.lua 16 additions, 17 deletionstest/app-tap/datetime.test.lua
Loading