Skip to main content
Version: Java (Groovy)

millisOfDay

millisOfDay returns the number of milliseconds since midnight for a specified date-time.

Syntax

millisOfDay(instant, timeZone)
millisOfDay(dateTime)

Parameters

ParameterTypeDescription
instantInstant

The date-time from which to return the elapsed time.

timeZoneZoneId

The time zone.

dateTimeZonedDateTime

The date-time from which to return the elapsed time.

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"))

println millis