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
Parameter | Type | Description |
---|---|---|
instant | Instant | The Instant to convert. |
timeZone | ZoneId | The time zone. |
dateTime | ZonedDateTime | The zoned date-time to convert. |
Returns
A LocalDate.
Examples
println toLocalDate(now(), timeZone("UTC"))
- Log