Skip to content
Snippets Groups Projects
Commit 29be5eb3 authored by Sergey Bronnikov's avatar Sergey Bronnikov Committed by Sergey Kaplun
Browse files

datetime: forbid using non-integer values in .new()

The patch forbids using non-integer values in datetime constructor
`datetime.new()` 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 `datetime.new()`

`datetime.new()` 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.

(cherry picked from commit cc9010a2b11477b2f16f2b2e168a6b9dcca2fb20)
parent 386fd018
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment