---
title: "dateComponents(for:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkactivitysummary/datecomponents(for:)"
---

# dateComponents(for:)

Date components that uniquely identify the day represented by the summary object.

## Declaration

```swift
func dateComponents(for calendar: Calendar) -> DateComponents
```

## Parameters

- `calendar`: The calendar used to calculate the date components.

## Return Value

Return Value Date components that uniquely specify a day. For example, for the Gregorian calendar, the date components consist of only the era, year, month, and day.

## Discussion

Discussion Each activity summary covers a single day. The day always begins and ends at midnight; however, the day may be longer or shorter than 24 hours (for example, if the user traveled across time zones).

## See Also

### Accessing the summary’s data

- [activityMoveMode](healthkit/hkactivitysummary/activitymovemode.md)
- [HKActivityMoveMode](healthkit/hkactivitymovemode.md)
- [activeEnergyBurned](healthkit/hkactivitysummary/activeenergyburned.md)
- [activeEnergyBurnedGoal](healthkit/hkactivitysummary/activeenergyburnedgoal.md)
- [appleMoveTime](healthkit/hkactivitysummary/applemovetime.md)
- [appleMoveTimeGoal](healthkit/hkactivitysummary/applemovetimegoal.md)
- [appleExerciseTime](healthkit/hkactivitysummary/appleexercisetime.md)
- [appleExerciseTimeGoal](healthkit/hkactivitysummary/appleexercisetimegoal.md)
- [exerciseTimeGoal](healthkit/hkactivitysummary/exercisetimegoal.md)
- [appleStandHours](healthkit/hkactivitysummary/applestandhours.md)
- [standHoursGoal](healthkit/hkactivitysummary/standhoursgoal.md)
- [appleStandHoursGoal](healthkit/hkactivitysummary/applestandhoursgoal.md)
- [HKCategoryValueAppleStandHour](healthkit/hkcategoryvalueapplestandhour.md)
