File tree Expand file tree Collapse file tree 5 files changed +99
-8
lines changed
doc/reference/reference_lua Expand file tree Collapse file tree 5 files changed +99
-8
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,26 @@ Below is a list of the ``datetime`` module functions and methods.
28
28
* - :ref: `format() <datetime-format >`
29
29
- Convert the standard presentation of a ``datetime `` object into a formatted string.
30
30
31
- * - :ref: `totable() <datetime-totable >`
31
+ * - :ref: `datetime_object: totable() <datetime-totable >`
32
32
- Convert the information from a ``datetime `` object into the table format.
33
33
34
34
* - :ref: `set() <datetime-set >`
35
35
- Update the field values in the existing ``datetime `` object.
36
36
37
+ * - :ref: `parse() <datetime-parse >`
38
+ - Convert an input string with the date and time information into a ``datetime `` object.
39
+
40
+ * - :ref: `add() <datetime-add >`
41
+ - Modify an existing datetime object by adding ... [TBD]
42
+
43
+ * - :ref: `sub() <datetime-sub >`
44
+ - Modify an existing datetime object by subtracting ... [TBD]
45
+
37
46
* - :doc: `./datetime/interval_new `
38
47
- Create an ``interval `` object from a table of time units.
39
48
49
+ * - :ref: `interval_object:totable() <interval-totable >`
50
+ - Convert the information from an ``interval `` object into the table format.
40
51
41
52
.. toctree ::
42
53
:hidden:
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ datetime_object
11
11
12
12
.. method :: totable()
13
13
14
- Convert the information from the ``datetime `` object into the table format.
14
+ Convert the information from a ``datetime `` object into the table format.
15
15
Resulting table has the following fields:
16
16
17
17
.. container :: table
@@ -245,7 +245,7 @@ datetime_object
245
245
246
246
.. _datetime-add :
247
247
248
- .. method :: add( { input[, adjust ] } )
248
+ .. method :: add( input[, { adjust } ] )
249
249
250
250
Modify an existing datetime object by adding values of the input argument. [TBD]
251
251
Original file line number Diff line number Diff line change 3
3
datetime.interval.new()
4
4
=======================
5
5
6
- .. function :: datetime.interval.new( [{ units }] )
6
+ .. function :: datetime.interval.new( [{ input }] )
7
7
8
8
Since :doc: `2.10.0 </release/2.10.0 >`.
9
9
10
10
Create an object of the :ref: `interval type <index-box_interval >` from a table of time units.
11
11
See :ref: `description of units <interval-new-args >` and :ref: `examples <interval-new-example >` below.
12
12
13
- :param table units : Table of :ref: `time units <interval-new-args >`. For all possible time units, the values are not restricted.
13
+ :param table input : Table with :ref: `time units and parameters <interval-new-args> `. For all possible time units, the values are not restricted.
14
14
If an empty table or no arguments are passed, the ``interval `` object with the default value ``0 seconds `` is created.
15
15
16
16
:return: :doc: interval object
17
17
:rtype: cdata
18
18
19
19
.. _interval-new-args :
20
20
21
- **Possible input time units for ``datetime.interval.new() **
21
+ **Possible input time units and parameters for ``datetime.interval.new() **
22
22
23
23
.. container :: table
24
24
@@ -68,10 +68,15 @@ datetime.interval.new()
68
68
- 0
69
69
70
70
* - year
71
- - Year
71
+ - Year. ... [TBD year range and huge year number support]
72
72
- number
73
73
- 0
74
74
75
+ * - adjust
76
+ - ... [TBD]
77
+ - string
78
+ - 'none'
79
+
75
80
.. _interval-new-example :
76
81
77
82
**Examples: **
Original file line number Diff line number Diff line change
1
+ .. _inverval_object :
2
+
3
+ inverval_object
4
+ ===============
5
+
6
+ .. class :: interval_object
7
+
8
+ Since :doc: `2.10.0 </release/2.10.0 >`.
9
+
10
+ .. _inverval-totable :
11
+
12
+ .. method :: totable()
13
+
14
+ Convert the information from an ``interval `` object into the table format.
15
+ Resulting table has the following fields:
16
+
17
+ .. container :: table
18
+
19
+ .. list-table ::
20
+ :widths: 30 70
21
+ :header-rows: 1
22
+
23
+ * - Field name
24
+ - Description
25
+
26
+ * - nsec
27
+ - Nanosecods
28
+
29
+ * - sec
30
+ - Seconds
31
+
32
+ * - min
33
+ - Minutes
34
+
35
+ * - hour
36
+ - Hours
37
+
38
+ * - day
39
+ - Day number
40
+
41
+ * - month
42
+ - Month number
43
+
44
+ * - year
45
+ - Year
46
+
47
+ * - week
48
+ - Week number
49
+
50
+ * - adjust
51
+ - ... [TBD]
52
+
53
+ :return: table with the date and time parameters
54
+ :rtype: table
55
+
56
+ **Example: **
57
+
58
+ .. code-block :: tarantoolsession
59
+
60
+ tarantool> iv = datetime.interval.new{month = 1, adjust = 'last'}
61
+ ---
62
+ ...
63
+
64
+ tarantool> iv:totable()
65
+ ---
66
+ - adjust: last
67
+ sec: 0
68
+ nsec: 0
69
+ day: 0
70
+ week: 0
71
+ hour: 0
72
+ month: 1
73
+ year: 0
74
+ min: 0
75
+ ...
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ datetime.new()
63
63
- 1
64
64
65
65
* - year
66
- - Year
66
+ - Year. ... [TBD year range and huge year number support]
67
67
- number
68
68
- 1970
69
69
You can’t perform that action at this time.
0 commit comments