Skip to main content
Version: Java (Groovy)

secondOfMinute

secondOfMinute returns the number of seconds that have elapsed since the top of the minute for the specified date-time.

Syntax

secondOfMinute(instant, timeZone)
secondOfMinute(dateTime)

Parameters

ParameterTypeDescription
instantInstant

The date-time from which to return the number of seconds.

timeZoneZoneId

The time zone.

dateTimeZonedDateTime

The date-time from which to return the number of seconds.

Returns

The specified date-time converted into seconds. Null input values will return NULL_LONG.

Examples

datetime = parseInstant("2022-03-01T12:34:56 ET")

second = secondOfMinute(datetime, timeZone("ET"))

println second