---
title: "predicateForEvaluatingTriggerOccurringBetweenDate(with:secondDateWith:)"
framework: homekit
role: symbol
role_heading: Type Method
path: "homekit/hmeventtrigger/predicateforevaluatingtriggeroccurringbetweendate(with:seconddatewith:)"
---

# predicateForEvaluatingTriggerOccurringBetweenDate(with:secondDateWith:)

Creates a predicate that evaluates whether the event occurred between the specified times.

## Declaration

```swift
class func predicateForEvaluatingTriggerOccurringBetweenDate(with firstDateComponents: DateComponents, secondDateWith secondDateWithComponents: DateComponents) -> NSPredicate
```

## Parameters

- `firstDateComponents`: Date components that represent the first time boundary to compare to the execution time.
- `secondDateWithComponents`: Date components that represent the second time boundary to compare to the execution time.

## Return Value

Return Value A predicate object that represents a condition to evaluate before executing the scene.

## See Also

### Creating predicates

- [predicateForEvaluatingTriggerOccurring(beforeSignificantEvent:)](homekit/hmeventtrigger/predicateforevaluatingtriggeroccurring(beforesignificantevent:).md)
- [predicateForEvaluatingTriggerOccurring(afterSignificantEvent:)](homekit/hmeventtrigger/predicateforevaluatingtriggeroccurring(aftersignificantevent:).md)
- [predicate(forEvaluatingTriggerOccurringBetweenSignificantEvent:secondSignificantEvent:)](homekit/hmeventtrigger/predicate(forevaluatingtriggeroccurringbetweensignificantevent:secondsignificantevent:).md)
- [predicateForEvaluatingTrigger(occurringBefore:)](homekit/hmeventtrigger/predicateforevaluatingtrigger(occurringbefore:).md)
- [predicateForEvaluatingTrigger(occurringOn:)](homekit/hmeventtrigger/predicateforevaluatingtrigger(occurringon:).md)
- [predicateForEvaluatingTrigger(occurringAfter:)](homekit/hmeventtrigger/predicateforevaluatingtrigger(occurringafter:).md)
- [predicateForEvaluatingTrigger(_:relatedBy:toValue:)](homekit/hmeventtrigger/predicateforevaluatingtrigger(_:relatedby:tovalue:).md)
- [predicateForEvaluatingTrigger(withPresence:)](homekit/hmeventtrigger/predicateforevaluatingtrigger(withpresence:).md)
- [HMCharacteristicKeyPath](homekit/hmcharacteristickeypath.md)
- [HMCharacteristicValueKeyPath](homekit/hmcharacteristicvaluekeypath.md)
- [HMPresenceKeyPath](homekit/hmpresencekeypath.md)
