<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/DateComponents/HTTPFormatStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation14DateComponentsV15HTTPFormatStyleV"
  },
  "title" : "DateComponents.HTTPFormatStyle"
}
-->

# DateComponents.HTTPFormatStyle

Converts `DateComponents` into RFC 9110-compatible “HTTP date” `String`, and parses in the reverse direction.
This parser does not do validation on the individual values of the components. An optional date can be created from the result using `Calendar(identifier: .gregorian).date(from: ...)`.
When formatting, missing or invalid fields are filled with default values: `Sun`, `01`, `Jan`, `2000`, `00:00:00`, `GMT`. Note that missing fields may result in an invalid date or time. Other values in the `DateComponents` are ignored.

```
struct HTTPFormatStyle
```

## Topics

### Initializers

[`init()`](/documentation/Foundation/DateComponents/HTTPFormatStyle/init())

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`ParseableFormatStyle`](/documentation/Foundation/ParseableFormatStyle)

[`CustomConsumingRegexComponent`](/documentation/Swift/CustomConsumingRegexComponent)

[`Escapable`](/documentation/Swift/Escapable)

[`Hashable`](/documentation/Swift/Hashable)

[`Copyable`](/documentation/Swift/Copyable)

[`Decodable`](/documentation/Swift/Decodable)

[`ParseStrategy`](/documentation/Foundation/ParseStrategy)

[`Equatable`](/documentation/Swift/Equatable)

[`FormatStyle`](/documentation/Foundation/FormatStyle)

[`Encodable`](/documentation/Swift/Encodable)

[`RegexComponent`](/documentation/Swift/RegexComponent)

---

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)