---
title: endDate
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hksample/enddate
---

# endDate

The sample’s end date.

## Declaration

```swift
var endDate: Date { get }
```

## Mentioned in

Adding samples to a workout

## Discussion

Discussion The sample’s end date must be equal to or later than its start date. Some samples—for example, body temperature—represent a single point in time. For these samples, both the start and the end date are the same, because they both refer to the point in time when the sample was taken. Other samples—for example, step count—represent data over a time interval. Here, the sample should use different start and end dates. These dates mark the beginning and end of the sample’s time interval, respectively.

## See Also

### Accessing the Sample’s Data

- [startDate](healthkit/hksample/startdate.md)
- [hasUndeterminedDuration](healthkit/hksample/hasundeterminedduration.md)
- [sampleType](healthkit/hksample/sampletype.md)
