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
Support non-zero tzindex in datetime extended type. If both tzoffset and
tzindex are specified, tzindex is prior (same as in Tarantool [1]).
pytz [2] is used to build timezone info. Tarantool index to Olson name
map and inverted one are built with gen_timezones.sh script based on
tarantool/go-tarantool script [3]. All Tarantool unique and alias
timezones presents in pytz.all_timezones list. Only the following
abrreviated timezones from Tarantool presents in pytz.all_timezones
(version 2022.2.1):
- CET
- EET
- EST
- GMT
- HST
- MST
- UTC
- WET
pytz does not natively support work with abbreviated timezones due to
its possibly ambiguous nature [4-6]. Tarantool itself do not support
work with ambiguous abbreviated timezones:
```
Tarantool 2.10.1-0-g482d91c66
tarantool> datetime.new({tz = 'BST'})
---
- error: 'builtin/datetime.lua:477: could not parse ''BST'' - ambiguous timezone'
...
```
If ambiguous timezone is specified, the exception is raised.
Tarantool header timezones.h [7] provides a map for all abbreviated
timezones with category info (all ambiguous timezones are marked with
TZ_AMBIGUOUS flag) and offset info. We parse this info to build
pytz.fixedOffset() timezone for each Tarantool abbreviated timezone not
supported natively by pytz. The warning is raised in this case.
Tarantool does not know of the following pytz version 2022.2.1
timezones:
- CST6CDT
- EST5EDT
- Etc/GMT+1
- Etc/GMT+10
- Etc/GMT+11
- Etc/GMT+12
- Etc/GMT+2
- Etc/GMT+3
- Etc/GMT+4
- Etc/GMT+5
- Etc/GMT+6
- Etc/GMT+7
- Etc/GMT+8
- Etc/GMT+9
- Etc/GMT-1
- Etc/GMT-10
- Etc/GMT-11
- Etc/GMT-12
- Etc/GMT-13
- Etc/GMT-14
- Etc/GMT-2
- Etc/GMT-3
- Etc/GMT-4
- Etc/GMT-5
- Etc/GMT-6
- Etc/GMT-7
- Etc/GMT-8
- Etc/GMT-9
- Europe/Kyiv
- MET
- MST7MDT
- PST8PDT
It is some utility timezones or new synonyms. For each timezone not
supported by Tarantool, we use tzoffset data from pytz object info
instead. The warning is raised in this case.
1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/datetime/new/
2. https://pypi.org/project/pytz/
3. https://github.com/tarantool/go-tarantool/blob/5801dc6f5ce69db7c8bc0c0d0fe4fb6042d5ecbc/datetime/gen-timezones.sh
4. https://stackoverflow.com/questions/37109945/how-to-use-abbreviated-timezone-namepst-ist-in-pytz
5. https://stackoverflow.com/questions/27531718/datetime-timezone-conversion-using-pytz
6. https://stackoverflow.com/questions/30315485/pytz-return-olson-timezone-name-from-only-a-gmt-offset
7. https://github.com/tarantool/tarantool/9ee45289e01232b8df1413efea11db170ae3b3b4/src/lib/tzcode/timezones.h
0 commit comments