Skip to main content
Version: Java (Groovy)

toInstant

toInstant converts the supplied variables into an instant.

Syntax

toInstant(date, time, timeZone)
toInstant(dateTime)

Parameters

ParameterTypeDescription
dateLocalDate

The local date.

timeLocalTime

The local time.

timeZoneZoneId

The time zone.

dateTimeZonedDateTime

The zoned date-time to convert.

Returns

An Instant.

Examples

date = parseLocalDate(today())
time = parseLocalTime("11:11:11")

tz = timeZone("ET")

instant = toInstant(date, time, tz)

println instant