<!--
{
  "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/Calendar/dateInterval(of:start:interval:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation8CalendarV12dateInterval2of5start8interval3forSbAC9ComponentO_AA4DateVzSdzALtF"
  },
  "title" : "dateInterval(of:start:interval:for:)"
}
-->

# dateInterval(of:start:interval:for:)

Returns, via two inout parameters, the starting time and duration of a given calendar component that contains a given date.

```
func dateInterval(of component: Calendar.Component, start: inout Date, interval: inout TimeInterval, for date: Date) -> Bool
```

## Parameters

`component`

A calendar component.

`start`

Upon return, the starting time of the calendar component that contains the date.

`interval`

Upon return, the duration of the calendar component that contains the date.

`date`

The specified date.

## Return Value

`true` if the starting time and duration of a component could be calculated; otherwise, `false`.

## Discussion

---

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)