DateFormatter

public extension DateFormatter
  • Produce a Date instance from an ISO 8601 formatted date string.

    Declaration

    Swift

    static func date(fromISO8601String string: String) -> Date?

    Parameters

    string

    An ISO 8601 formatted date string. The expected format is governed by the JSONCache.dateFormat setting.

    Return Value

    The Date instance represented by the string.

  • Produce an ISO 8601 formatted date string from a Date instance. The specific format of the produced string is governed by the JSONCache.dateFormat setting.

    Declaration

    Swift

    static func iso8601String(from date: Date) -> String

    Return Value

    A string representation of the Date instance.