Commits
- Commit:
f956ff516bfe9b7c95529f53afe66ad59e337641
- From:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Date:
datetime: introduce tz in datetime.parse()
There is an option tz in `datetime.parse()`, it was added in
commit 3c40366172e3 ("datetime, lua: date parsing functions").
The option is not documented, and the commit message says that
option `tz` is "Not yet implemented in this commit.".
The patch added tests and a doc request for this option.
The behaviour of the option `tz` is the same as with option
`tzoffset`:
- if timezone was not set in a parsed string then it is set to
a value specified by `tz`
- if timezone was set in a parsed string then option `tz` is
ignored
```
tarantool> date.parse("1970-01-01T01:00:00 MSK", { tz = 'Europe/Paris' })
---
- 1970-01-01T01:00:00 MSK
- 23
...
tarantool> date.parse("1970-01-01T01:00:00", { tz = 'Europe/Paris' })
---
- 1970-01-01T01:00:00 Europe/Paris
- 19
...
```
Follows up #6731
Fixes #10420
@TarantoolBot document
Title: Introduce option `tz` in `datetime.parse()`
The option `tz` is added in a function `datetime.parse()`.
The option set timezone to a passed value if it was not set in
a parsed string.
- Commit:
04811e032f29afe0fa6206ef2c7a0f8434861830
- From:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Via:
- Sergey Kaplun <sergey_v_kaplun@mail.ru>
- Date:
datetime: use tzoffset in a parse() with custom format
The patch fixes a behaviour, when `datetime.parse()` ignores
`tzoffset` option if custom format is used.
Fixes #8333
Relates to #10420
NO_DOC=bugfix
- Commit:
d7d3063fbd5a74563fde539f2c74852a1e04c1cd
- From:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Via:
- Sergey Kaplun <sergey_v_kaplun@mail.ru>
- Date:
refactoring: datetime_parse_full drop parse offset
The patch refactors a function `datetime_parse_full()` -
overriding of timezone is not a part of datetime string parsing
and this part was removed.
Needed for #8333
NO_CHANGELOG=refactoring
NO_DOC=refactoring
NO_TEST=refactoring
- Commit:
f57be571b5e4cc8d57c7e97c15b52df37ad6f12c
- From:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Via:
- Sergey Kaplun <sergey_v_kaplun@mail.ru>
- Date:
sql: forbid non-integer values in datetime
The patch forbids using non-integer values in datetime's `:set()`
for `year`, `month`, `day`, `hour`, `min`, `sec`, `usec`, `msec`,
`nsec` and `tzoffset` keys. `timestamp` can be double, and integer
values allowed in timestamp if `nsec`, `usec`, or `msecs`
provided. An error will be raised when a value of incorrect type
is passed.
Fixes #10391
@TarantoolBot document
Title: Update types of datetime values passed to SQL's `CAST();`
`CAST` can accept only integer values for `year`, `month`, `day`,
`hour`, `min`, `sec`, `usec`, `msec`, `nsec` and `tzoffset`.
`timestamp` can be integer or double.
- Commit:
6e77907baa3cbeebc79241cc0046a539a09e3f2c
- From:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Via:
- Sergey Kaplun <sergey_v_kaplun@mail.ru>
- Date:
datetime: forbid non-integers in :set() and parse()
The patch forbids using non-integer values in datetime's `:set()`
for `year`, `month`, `day`, `hour`, `min`, `sec`, `usec`, `msec`
and `nsec` keys. The type of `tzoffset` can be integer or string,
`timestamp` can be double, and integer values allowed in timestamp
if `nsec`, `usec`, or `msecs` provided. An error will be raised
when a value of incorrect type is passed.
Part of #10391
@TarantoolBot document
Title: Update types of values passed to `:set()` and parse()
`:set()` can accept only integer values for `year`, `month`,
`day`, `hour`, `min`, `sec`, `usec`, `msec` and `nsec`.
The type of `tzoffset` can be integer or string, `timestamp` can
be integer or double. `tzoffset` passed to `datetime.parse()`
can be integer or string.