formatDate

formatDate returns a string representation of a date-time for a specified time zone, formatted as yyyy-MM-dd.

Syntax

Parameters

ParameterTypeDescription
instantInstant

The Instant to format as a string.

timeZoneZoneId

The time zone used when formatting the string.

dateTimeZonedDateTime

The time to format as a string.

Returns

The time, formatted as a yyyy-MM-dd string.

Examples