DateFormatter
public extension DateFormatter
-
Produce a
Dateinstance from an ISO 8601 formatted date string.Declaration
Swift
static func date(fromISO8601String string: String) -> Date?Parameters
stringAn ISO 8601 formatted date string. The expected format is governed by the
JSONCache.dateFormatsetting.Return Value
The
Dateinstance represented by the string. -
Produce an ISO 8601 formatted date string from a
Dateinstance. The specific format of the produced string is governed by theJSONCache.dateFormatsetting.Declaration
Swift
static func iso8601String(from date: Date) -> StringReturn Value
A string representation of the
Dateinstance.
View on GitHub
DateFormatter Extension Reference