millisOfDay
millisOfDay
returns the number of milliseconds since midnight for a specified date-time.
Syntax
millisOfDay(instant, timeZone, localTime)
millisOfDay(dateTime, localTime)
millisOfDay(localTime)
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. |
localTime | boolean | Set this parameter to
|
Returns
Returns the number of milliseconds since midnight for the date-time, or NULL_INT
if dt is None
.
Examples
datetime = parseInstant("2023-09-09T12:34:56.123456 ET")
millis = millisOfDay(datetime, timeZone("ET"), false)
println millis
- Log