Skip to content

feedback: Module datetime | Tarantool #4470

Open
@TarantoolBot

Description

@TarantoolBot

<…> seconds is created.

Return:interval_object
Return type:cdata

**|Possible input time units and parameters for datetime.interval.new()

Name
Description
Type
Default

nsec (usec, msec)
Fractional part of the last second. You can specify either nanoseconds (nsec), or microseconds (usec), or milliseconds (msec).
Specifying two of these units simultaneously or all three ones lead to an error.
number
0

sec
Seconds
number
0

min
Minutes
number
0

hour
Hours
number
0

day
Day number
number
0

week
Week number
number
0

month
Month number
number
0

year
Year
number
0|**

adjust
Defines how to round days in a month after an arithmeti<…>

https://www.tarantool.io/en/doc/latest/reference/reference_lua/datetime/#datetime-interval-new

using double in datetime.interval.new() is not allowed:

tarantool> datetime.interval.new({sec = 0.1})
---
- error: 'sec: integer value expected, but received number'
...

tarantool> datetime.interval.new({min = 0.1})
---
- error: 'min: integer value expected, but received number'
...

tarantool> datetime.interval.new({hour = 0.1})
---
- error: 'hour: integer value expected, but received number'
...

tarantool> datetime.interval.new({day = 0.1})
---
- error: 'day: integer value expected, but received number'
...

tarantool> datetime.interval.new({week = 0.1})
---
- +0 seconds
...
tarantool> datetime.interval.new({month = 0.1})
---
- error: 'month: integer value expected, but received number'
...

tarantool> datetime.interval.new({year = 0.1})
---
- error: 'year: integer value expected, but received number'
...

But documentation for datetime.interval.new() describe a type of possible inputs as number.

Metadata

Metadata

Assignees

Labels

datetimefactual errorFactual error in functionality description

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions