Contents

string(from:)

Returns a string representation of a specified date that the system formats using the receiver’s current settings.

Declaration

func string(from date: Date) -> String

Parameters

  • date:

    The date to format.

Return Value

A string representation of date.

Discussion

For more information about using DateFormatter to produce a string representation of a date, see Working With User-Visible Representations of Dates and Times. For a sample code playground, see Displaying Human-Friendly Content.

See Also

Converting Objects