millisOfSecond
millisOfSecond
returns the number of milliseconds since the top of the second for a specified date-time.
Syntax
millisOfSecond(instant, timeZone)
millisOfSecond(dateTime)
Parameters
Parameter | Type | Description |
---|---|---|
instant | Instant | The date-time from which to return the elapsed time. |
timeZone | ZoneId | The time zone. |
dateTime | ZonedDateTime | The date-time from which to return the elapsed time. |
Returns
Returns the number of milliseconds since the top of the second for the date-time, or NULL_INT
if dt is None
.
Examples
datetime = parseInstant("2023-09-09T12:34:56.123456 ET")
millis = millisOfSecond(datetime, timeZone("ET"))
println millis
- Log