Skip to main content
Version: Java (Groovy)

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

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