<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/JSONEncoder/dateEncodingStrategy-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation11JSONEncoderC20dateEncodingStrategyAC04DatedE0Ovp"
  },
  "title" : "dateEncodingStrategy"
}
-->

# dateEncodingStrategy

The strategy used when encoding dates as part of a JSON object.

```
var dateEncodingStrategy: JSONEncoder.DateEncodingStrategy { get set }
```

## Discussion

The default strategy is the [`JSONEncoder.DateEncodingStrategy.deferredToDate`](/documentation/Foundation/JSONEncoder/DateEncodingStrategy-swift.enum/deferredToDate) strategy.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)