datetime.interval.new() | Tarantool
Документация на русском языке
поддерживается сообществом

datetime.interval.new()

datetime.interval.new([{ units }])

Since 2.10.0.

Create an object of the interval type from a table of time units. See description of units and examples below.

Параметры:
  • units (table) – Table of time units. For all possible time units, the values are not restricted. If an empty table or no arguments are passed, the interval object with the default value 0 seconds is created.
Return:
doc:interval object
Rtype:

cdata

Possible input time units 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

Examples:

tarantool> datetime.interval.new()

---
- 0 seconds
...

tarantool> datetime.interval.new {
            month = 6,
            year = 1
            }
---
- +1 years, 6 months
...

tarantool> datetime.interval.new {
            day = -1
            }
---
- -1 days
...
Нашли ответ на свой вопрос?
Обратная связь