Skip to main content
Version: Java (Groovy)

toZonedDateTime

toZonedDateTime converts the supplied variables into a ZonedDateTime.

Syntax

toInstant(instant, timeZone)
toInstant(date, time, timeZone)

Parameters

ParameterTypeDescription
instantInstant

The Instant to convert.

dateLocalDate

The local date.

timeLocalTime

The local time.

timeZoneZoneId

The time zone.

Returns

A ZonedDateTime.

Examples

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

tz = timeZone("ET")

zdt = toZonedDateTime(date, time, tz)

println zdt