Skip to main content
Version: Java (Groovy)

toLocalDate

The toLocalDate method converts the supplied variables into a LocalDate.

A LocalDate is a Java object that represents a date with no time zone - for example, "1995-05-23".

Syntax

toLocalDate(instant, timeZone)
toLocalDate(dateTime)

Parameters

ParameterTypeDescription
instantInstant

The Instant to convert.

timeZoneZoneId

The time zone.

dateTimeZonedDateTime

The zoned date-time to convert.

Returns

A LocalDate.

Examples

println toLocalDate(now(), timeZone("UTC"))