Instance Method

string(from:)

Returns a string representation of a given date formatted 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 formatted using the receiver’s current settings.

See Also

Converting Objects

func date(from: String) -> Date?

Returns a date representation of a given string interpreted using the receiver’s current settings.

class func localizedString(from: Date, dateStyle: DateFormatter.Style, timeStyle: DateFormatter.Style) -> String

Returns a string representation of a given date, formatted for the current locale using the specified date and time styles.

func getObjectValue(AutoreleasingUnsafeMutablePointer<AnyObject?>?, for: String, range: UnsafeMutablePointer<NSRange>?)

Returns by reference a date representation of a given string and the range of the string used, and returns a Boolean value that indicates whether the string could be parsed.