DateEncoding

public enum DateEncoding

Encoding to use for Date values.

  • Defers encoding to the Date type. This is the default encoding.

    Declaration

    Swift

    case deferredToDate
  • Encodes Dates as seconds since midnight UTC on January 1, 1970.

    Declaration

    Swift

    case secondsSince1970
  • Encodes Dates as milliseconds since midnight UTC on January 1, 1970.

    Declaration

    Swift

    case millisecondsSince1970
  • Encodes Dates according to the ISO8601 and RFC3339 standards.

    Declaration

    Swift

    case iso8601
  • Encodes Dates using the given DateFormatter.

    Declaration

    Swift

    case formatted(DateFormatter)
  • Encodes Dates using the given closure.

    Declaration

    Swift

    case custom((Date) throws -> String)