---
title: earliestPermittedSampleDate()
framework: healthkit
role: symbol
role_heading: Instance Method
path: healthkit/hkhealthstore/earliestpermittedsampledate()
---

# earliestPermittedSampleDate()

Returns the earliest date permitted for samples.

## Declaration

```swift
func earliestPermittedSampleDate() -> Date
```

## Mentioned in

About the HealthKit framework

## Return Value

Return Value The earliest date that samples can use. You cannot save or query samples prior to this date.

## Discussion

Discussion Attempts to save samples earlier than this date fail with an HKError.Code.errorInvalidArgument error. Attempts to query samples before this date return samples after this date.

## See Also

### Working with HealthKit objects

- [delete(_:withCompletion:)](healthkit/hkhealthstore/delete(_:withcompletion:)-78l1m.md)
- [delete(_:withCompletion:)](healthkit/hkhealthstore/delete(_:withcompletion:)-17hzm.md)
- [deleteObjects(of:predicate:withCompletion:)](healthkit/hkhealthstore/deleteobjects(of:predicate:withcompletion:).md)
- [save(_:withCompletion:)](healthkit/hkhealthstore/save(_:withcompletion:)-6fmtg.md)
- [save(_:withCompletion:)](healthkit/hkhealthstore/save(_:withcompletion:)-47iwb.md)
