---
title: "mostRecentQuantityDateInterval(for:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkstatistics/mostrecentquantitydateinterval(for:)"
---

# mostRecentQuantityDateInterval(for:)

Returns the date interval of the most recent sample that matches the query and was created by the specified source.

## Declaration

```swift
func mostRecentQuantityDateInterval(for source: HKSource) -> DateInterval?
```

## See Also

### Related Documentation

- [discreteMostRecent](healthkit/hkstatisticsoptions/discretemostrecent.md)

### Getting the Most Recent Quantity

- [mostRecentQuantity()](healthkit/hkstatistics/mostrecentquantity().md)
- [mostRecentQuantity(for:)](healthkit/hkstatistics/mostrecentquantity(for:).md)
- [mostRecentQuantityDateInterval()](healthkit/hkstatistics/mostrecentquantitydateinterval().md)
