time
- Description:
Time namespace. This namespace exports the JS-Joda library, but also provides additional functionality.
- Source:
Methods
(static) javaInstantToJsInstant(instant) → {time.Instant}
Parameters:
Name | Type | Description |
---|---|---|
instant |
JavaInstant |
Returns:
- Type
- time.Instant
(static) javaZDTToJsZDT(zdt) → {time.ZonedDateTime}
Parameters:
Name | Type | Description |
---|---|---|
zdt |
JavaZonedDateTime |
Returns:
- Type
- time.ZonedDateTime
(static) toZDT(whenopt) → {time.ZonedDateTime}
- Description:
Converts the passed in when to a time.ZonedDateTime based on the following set of rules.
- null, undefined: time.ZonedDateTime.now()
- time.ZonedDateTime: unmodified
- Java ZonedDateTime, DateTimeType: converted to time.ZonedDateTime equivalent
- JavaScript native Date: converted to a
time.ZonedDateTime
using configured timezone - number, bigint, Java Number, DecimalType: rounded and added to
time.ZonedDateTime.now()
as milliseconds Quantity
& QuantityType: if the unit is time-compatible, added totime.ZonedDateTime.now()
- Item: converts the state of the Item based on the *Type rules described here
- String, Java String, StringType: parsed based on the following rules; if no timezone is specified the configured timezone is used
- ISO 8601 DateTime: any Date, Time or DateTime with optional time offset and/or time zone in the ISO8601 calendar system
- ISO 8601 Duration: any Duration in the ISO8601 calendar system (e.g. 'PT5H4M3.210S'), also see JS-Joda : Duration
- RFC (output from a Java ZonedDateTime.toString()): parsed to time.ZonedDateTime
- HH:mm[:ss] (i.e. 24 hour time): that time with today's date (seconds are optional)
- KK:mm[:ss][ ][aa] (i.e. 12 hour time): that time with today's date (seconds and space between time and am/pm are optional)
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
when |
* |
<optional> |
any of the types discussed above |
Throws:
error if the type, format, or contents of when are not supported
Returns:
- Type
- time.ZonedDateTime