Skip to content

Instance MethodFoundationEssentials

format(_:)

iOS 15.0+ iPadOS 15.0+ Mac Catalyst 15.0+ macOS 12.0+ tvOS 15.0+ watchOS 8.0+
Creates a locale-aware ISO 8601 string representation from a date value.
func format(_ value: Date) -> String

Parameters

value

The date to format.

Return Value

A string ISO 8601 representation of the date.

Discussion

Once you create a style, you can use it to format dates multiple times.