secondOfDay
secondOfDay
returns the number of seconds that have elapsed since the top of the day (midnight) for the specified date-time.
Syntax
secondOfDay(instant, timeZone, localTime)
secondOfDay(dateTime, localTime)
Parameters
Parameter | Type | Description |
---|---|---|
instant | Instant | The date-time from which to return the number of seconds. |
timeZone | ZoneId | The time zone. |
dateTime | ZonedDateTime | The date-time from which to return the number of seconds. |
localTime | boolean | Set this parameter to
|
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 = secondOfDay(datetime, timeZone("ET"), false)
println second
- Log