Contents

format(_:)

Creates a locale-aware attributed string representation from a date value.

Declaration

func format(_ value: Date) -> AttributedString

Parameters

  • value:

    The date to format.

Return Value

An attributed string representation of the date.

Discussion

The Date.ISO8601FormatStyle format(_:) instance method generates an attributed string from the provided date. Once you create a style, you can use it to format dates multiple times.

For an example of formatting multiple dates into plain strings, see format(_:).