Enumeration Caseswift 6.0.3FoundationEssentials
secondsSince1970
Encode the Date
as a UNIX timestamp (as a JSON number).
- iOS
- 8.0+
- macOS
- 10.10+
- tvOS
- 9.0+
- watchOS
- 2.0+
case secondsSince1970
Encode the Date
as a UNIX timestamp (as a JSON number).
case secondsSince1970
s20FoundationEssentials11JSONEncoderC20DateEncodingStrategyO16secondsSince1970yA2EmF
What are these?9QD0X
import FoundationEssentials
enum DateEncodingStrategy
The strategy to use for encoding Date
values.
class JSONEncoder
JSONEncoder
facilitates the encoding of Encodable
values into JSON.
@preconcurrency case custom((Date, any Encoder) throws -> Void)
Encode the Date
as a custom value encoded by the given closure.
case deferredToDate
Defer to Date
for choosing an encoding. This is the default strategy.
case iso8601
Encode the Date
as an ISO-8601-formatted string (in RFC 3339 format).
case millisecondsSince1970
Encode the Date
as UNIX millisecond timestamp (as a JSON number).