You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Library/datetime.lua
+21-25Lines changed: 21 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -5,22 +5,21 @@
5
5
localdatetime= {}
6
6
7
7
---@classdatetime:ffi.cdata*
8
-
---@fieldnsecnumber(Default: 0) (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
9
-
---@fieldsecnumber(Default: 0) Seconds. Value range: 0 - 60
10
-
---@fieldminnumber(Default: 0) Minutes. Value range: 0 - 59
11
-
---@fieldhournumber(Default: 0) Hours. Value range: 0 - 23
12
-
---@fielddaynumber(Default: 1) Day number. Value range: 1 - 31. The special value -1 generates the last day of a particular month (see example below)
13
-
---@fieldmonthnumber(Default: 1) Month number. Value range: 1 - 12
14
-
---@fieldyearnumber(Default: 1970) Year.
15
-
---@fieldtimestampnumber(Default: 0) Timestamp, in seconds. Similar to the Unix timestamp, but can have a fractional part which is converted in nanoseconds in the resulting datetime object. If the fractional part for the last second is set via the nsec, usec, or msec units, the timestamp value should be integer otherwise an error occurs. Timestamp is not allowed if you already set time and/or date via specific units, namely, sec, min, hour, day, month, and year
16
-
---@fieldtzoffsetnumber(Default: 0) Time zone offset from UTC, in minutes. If both tzoffset and tz are specified, tz has the preference and the tzoffset value is ignored
8
+
---@fieldnsecinteger(Default: 0) (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
9
+
---@fieldsecinteger(Default: 0) Seconds. Value range: 0 - 60
10
+
---@fieldmininteger(Default: 0) Minutes. Value range: 0 - 59
11
+
---@fieldhourinteger(Default: 0) Hours. Value range: 0 - 23
12
+
---@fielddayinteger(Default: 1) Day number. Value range: 1 - 31. The special value -1 generates the last day of a particular month (see example below)
13
+
---@fieldmonthinteger(Default: 1) Month number. Value range: 1 - 12
14
+
---@fieldyearinteger(Default: 1970) Year.
15
+
---@fieldtimestampinteger(Default: 0) Timestamp, in seconds. Similar to the Unix timestamp, but can have a fractional part which is converted in nanoseconds in the resulting datetime object. If the fractional part for the last second is set via the nsec, usec, or msec units, the timestamp value should be integer otherwise an error occurs. Timestamp is not allowed if you already set time and/or date via specific units, namely, sec, min, hour, day, month, and year
16
+
---@fieldtzoffsetinteger(Default: 0) Time zone offset from UTC, in minutes. If both tzoffset and tz are specified, tz has the preference and the tzoffset value is ignored
17
17
---@fieldtzstring Time zone name according to the tz database
18
-
---@fieldwdaynumber Days since the beginning of the week
19
-
---@fieldydaynumber Days since the beginning of the year
18
+
---@fieldwdayinteger Days since the beginning of the week
19
+
---@fieldydayinteger Days since the beginning of the year
20
20
---@fieldisdstboolean Is the DST (Daylight saving time) applicable for the date. Boolean.
21
21
localdatetime_obj= {}
22
22
23
-
24
23
--- Create a datetime object from a table of time units.
@@ -58,24 +57,22 @@ function datetime_obj:add() end
58
57
--- Modify an existing datetime object by subtracting values of the input arguments
59
58
functiondatetime_obj:sub() end
60
59
61
-
62
60
datetime.interval= {}
63
61
64
62
---@classinterval:ffi.cdata*
65
-
---@fieldnsecnumber(Default: 0) (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
66
-
---@fieldsecnumber(Default: 0) Seconds
67
-
---@fieldminnumber(Default: 0) Minutes
68
-
---@fieldhournumber(Default: 0) Hours
69
-
---@fielddaynumber(Default: 0) Day number
70
-
---@fieldweeknumber(Default: 0) Week number
71
-
---@fieldmonthnumber(Default: 0) Month number
72
-
---@fieldyearnumber(Default: 0) Year
63
+
---@fieldnsecinteger(Default: 0) (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
64
+
---@fieldsecinteger(Default: 0) Seconds
65
+
---@fieldmininteger(Default: 0) Minutes
66
+
---@fieldhourinteger(Default: 0) Hours
67
+
---@fielddayinteger(Default: 0) Day number
68
+
---@fieldweekinteger(Default: 0) Week number
69
+
---@fieldmonthinteger(Default: 0) Month number
70
+
---@fieldyearinteger(Default: 0) Year
73
71
---@fieldadjuststring (Default: 'none') Defines how to round days in a month after an arithmetic operation
74
72
---@operatoradd(interval): interval
75
73
---@operatorsub(interval): interval
76
74
localinterval_obj= {}
77
75
78
-
79
76
--- Create an interval object from a table of time units
0 commit comments