Instance Method


Returns a string representation of the date using the given locale.


func description(with locale: Locale?) -> String



A Locale. If you pass nil, Date formats the date in the same way as the description property.

Return Value

A string representation of the Date, using the given locale, or if the locale argument is nil, in the international format YYYY-MM-DD HH:MM:SS ±HHMM, where ±HHMM represents the time zone offset in hours and minutes from UTC (for example, “2001-03-24 10:45:32 +0600”).

See Also

Describing Dates

var description: String

A textual description of the date value.

var debugDescription: String

A textual description of the date suitable for debugging.

var customMirror: Mirror

A mirror that reflects the date.

var hashValue: Int

The computed hash value of the date.

var customPlaygroundQuickLook: PlaygroundQuickLook

A custom playground Quick Look for the date.