Functions -
time
addDuration | Add specified durations to the given time value. |
createTime | Returns the Time object correspoding to the given time components and time-zone. |
currentTime | Returns the current time value with the system default time-zone. |
format | Returns formatted string representation of the given time. |
getDate | Returns the date representation of the given time. |
getDay | Returns the date representation of the given time. |
getHour | Returns the hour representation of the given time. |
getMilliSecond | Returns the millisecond representation of the given time. |
getMinute | Returns the minute representation of the given time. |
getMonth | Returns the month representation of the given time. |
getSecond | Returns the second representation of the given time. |
getTime | Returns the time representation of the given time. |
getWeekday | Returns the weekday representation of the given time. |
getYear | Returns the year representation of the given time. |
nanoTime | Returns the current system time in nano seconds. |
parse | Returns the time for the given string representation based on the given format string. |
subtractDuration | Subtract specified durations from the given time value. |
toString | Returns ISO 8601 string representation of the given time. |
toTimeZone | Change the time-zone of the given time. |
addDuration
(Time time, int years, int months, int days, int hours, int minutes, int seconds, int milliSeconds)
returns TimeAdd specified durations to the given time value.
Parameters
- time Time
-
The Time record to add the duration to
- years int
-
The year representation
- months int
-
The month-of-year to represent, from 1 (January) to 12 (December)
- days int
-
The day-of-month to represent, from 1 to 31
- hours int
-
The hour-of-day to represent, from 0 to 23
- minutes int
-
The minute-of-hour to represent, from 0 to 59
- seconds int
-
The second-of-minute to represent, from 0 to 59
- milliSeconds int
-
The milli-of-second to represent, from 0 to 999
-
Return Type
(Time) Time object containing time and zone information after the addition
createTime
(int year, int month, int date, int hour, int minute, int second, int milliSecond, string zoneId)
returns Time | ErrorReturns the Time object correspoding to the given time components and time-zone.
Parameters
- year int
-
The year representation
- month int
-
The month-of-year to represent, from 1 (January) to 12 (December)
- date int
-
The day-of-month to represent, from 1 to 31
- hour int
-
The hour-of-day to represent, from 0 to 23
- minute int
-
The minute-of-hour to represent, from 0 to 59
- second int
-
The second-of-minute to represent, from 0 to 59
- milliSecond int
-
The milli-of-second to represent, from 0 to 999
- zoneId string
-
The zone id of the required time-zone.If empty the system local time-zone will be used
Returns the current time value with the system default time-zone.
-
Return Type
(Time) Time object containing the time and zone information
Returns formatted string representation of the given time.
Parameters
- time Time
-
The Time record to be formatted
- timeFormat string
-
The format which is used to format the time represented by this object
-
Return Type
(string | Error) The formatted string of the given time or an
time:Error
if failed to format the time
Returns the date representation of the given time.
Parameters
- time Time
-
The Time record to get the date representation from
-
Return Type
([int, int, int]) The year representation. The month-of-year, from 1 (January) to 12 (December). The day-of-month, from 1 to 31.
Returns the date representation of the given time.
Parameters
- time Time
-
The Time record to get the date representation from
-
Return Type
(int) The day-of-month, from 1 to 31
Returns the hour representation of the given time.
Parameters
- time Time
-
The Time record to get the hour representation from
-
Return Type
(int) The hour-of-day, from 0 to 23
Returns the millisecond representation of the given time.
Parameters
- time Time
-
The Time record to get the millisecond representation from
-
Return Type
(int) The milli-of-second, from 0 to 999
Returns the minute representation of the given time.
Parameters
- time Time
-
The Time record to get the minute representation from
-
Return Type
(int) The minute-of-hour to represent, from 0 to 59
Returns the month representation of the given time.
Parameters
- time Time
-
The Time record to get the month representation from
-
Return Type
(int) The month-of-year, from 1 (January) to 12 (December)
Returns the second representation of the given time.
Parameters
- time Time
-
The Time record to get the second representation from
-
Return Type
(int) The second-of-minute, from 0 to 59
Returns the time representation of the given time.
Parameters
- time Time
-
The Time record
-
Return Type
([int, int, int, int]) The hour-of-day, from 0 to 23. The minute-of-hour to represent, from 0 to 59. The second-of-minute, from 0 to 59. The milli-of-second, from 0 to 999.
Returns the weekday representation of the given time.
Parameters
- time Time
-
The Time record to get the weekday representation from
-
Return Type
(string) The weekday representation from SUNDAY to SATURDAY
Returns the year representation of the given time.
Parameters
- time Time
-
The Time record to retrieve the year representation from
-
Return Type
(int) The year representation
Returns the current system time in nano seconds.
-
Return Type
(int) Int value of the current system time in nano seconds
Returns the time for the given string representation based on the given format string.
Parameters
- data string
-
The time text to parse
- timeFormat string
-
The format which is used to parse the given text
subtractDuration
(Time time, int years, int months, int days, int hours, int minutes, int seconds, int milliSeconds)
returns TimeSubtract specified durations from the given time value.
Parameters
- time Time
-
The Time record to subtract the duration from
- years int
-
The year representation
- months int
-
The month-of-year to represent, from 1 (January) to 12 (December)
- days int
-
The day-of-month to represent, from 1 to 31
- hours int
-
The hour-of-day to represent, from 0 to 23
- minutes int
-
The minute-of-hour to represent, from 0 to 59
- seconds int
-
The second-of-minute to represent, from 0 to 59
- milliSeconds int
-
The milli-of-second to represent, from 0 to 999
-
Return Type
(Time) Time object containing time and zone information after the subtraction
Returns ISO 8601 string representation of the given time.
Parameters
- time Time
-
The Time record to be converted to string
-
Return Type
(string) The ISO 8601 formatted string of the given time
Change the time-zone of the given time.
Parameters
- time Time
-
The Time record of which the time-zone to be changed
- zoneId string
-
The new time-zone id