<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKStatisticsCollectionQuery/intervalComponents",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKStatisticsCollectionQuery(py)intervalComponents"
  },
  "title" : "intervalComponents"
}
-->

# intervalComponents

The date components that define the time interval for each statistics object in the collection.

```
var intervalComponents: DateComponents { get }
```

## Discussion

This property defines the length of the time intervals for your collection. The following code sample shows a number of common time intervals.

```objc
NSDateComponents *fiveMinutes = [[NSDateComponents alloc] init];
fiveMinutes.minute = 5;
 
NSDateComponents *hour = [[NSDateComponents alloc] init];
hour.hour = 1;
 
NSDateComponents *day = [[NSDateComponents alloc] init];
day.day = 1;
 
NSDateComponents *week = [[NSDateComponents alloc] init];
week.day = 7;
 
NSDateComponents *month = [[NSDateComponents alloc] init];
month.month = 1;
 
NSDateComponents *year = [[NSDateComponents alloc] init];
year.year = 1;
```

---

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)