<!--
{
  "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/init(_:strategy:)-84m93",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation14DateComponentsV_8strategyAC10ParseInputQz_xtKcAA0E8StrategyRzAC0E6OutputRtzlufc"
  },
  "title" : "init(_:strategy:)"
}
-->

# init(_:strategy:)

Creates a new `DateComponents` by parsing the given representation.

```
init<T>(_ value: T.ParseInput, strategy: T) throws where T : ParseStrategy, T.ParseOutput == DateComponents
```

## Parameters

`value`

A representation of a date. The type of the representation is specified by `ParseStrategy.ParseInput`.

`strategy`

The parse strategy to parse `value` whose `ParseOutput` is `DateComponents`.

---

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)