Enumeration
JSONEncoder.DateEncodingStrategy
iOS 8.0+
iPadOS 8.0+
Mac Catalyst 8.0+
macOS 10.10+
tvOS 9.0+
watchOS 2.0+
The formatting strategies available for formatting dates when encoding a date as JSON.
enum DateEncodingStrategy
Topics
Enumeration Cases
case custom((Date, any Encoder) throws -> Void)The strategy that formats custom dates by calling a user-defined function.case deferredToDateThe strategy that uses formatting from the Date structure.case iso8601The strategy that formats dates according to the ISO 8601 and RFC 3339 standards.case millisecondsSince1970The strategy that encodes dates in terms of milliseconds since midnight UTC on January 1, 1970.case secondsSince1970The strategy that encodes dates in terms of seconds since midnight UTC on January 1, 1970.
Type Properties
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype