# How to make sure that an event only happens between 2 specific times

**URL:** <https://community.homey.app/t/how-to-make-sure-that-an-event-only-happens-between-2-specific-times/85960>\
**Category:** Questions & Help\
**Tags:** flow, homey-pro\
**Created:** [August 3, 2023, 8:06am UTC](https://community.homey.app/t/how-to-make-sure-that-an-event-only-happens-between-2-specific-times/85960 "2023-08-03T08:06:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keld8382](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/keld8382/32/79601_2.png) [@Keld8382](https://community.homey.app/u/Keld8382)\
**Post date:** [August 3, 2023, 8:06am UTC](https://community.homey.app/t/how-to-make-sure-that-an-event-only-happens-between-2-specific-times/85960/1 "2023-08-03T08:06:51Z")

</div>

I am new to the Homey/Homey Pro platform, and I am trying to create at simple slow, that will turn on my light in my kitchen when my motion sensor in my hall detects motion. I only want that to happen every workday and only between 22:00 and 23:59. When I use the ‘Hour between’ card it always failes, because ‘the second time is after the first’ - What am I missing here?

 ![Flow](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/d/5dd21406a0c958af519443af92d4a7f920fb74f7.png)  
All the best Keld 🙂

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [August 3, 2023, 8:13am UTC](https://community.homey.app/t/how-to-make-sure-that-an-event-only-happens-between-2-specific-times/85960/2 "2023-08-03T08:13:27Z")

</div>

Why is the card showing “between 23:59 and 22:15”? That’s the wrong way around.

---

<div class="post-metadata">

**Author:** ![Marcus\_Car](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcus_car/32/79647_2.png) [@Marcus\_Car](https://community.homey.app/u/Marcus_Car)\
**Post date:** [August 3, 2023, 8:31am UTC](https://community.homey.app/t/how-to-make-sure-that-an-event-only-happens-between-2-specific-times/85960/3 "2023-08-03T08:31:13Z")

</div>

They way you have it “23:59 and 22:00” is backwards. The error message is correct as 22:00 won’t occur until the next day.  
You need to change it from “23:59 and 22:00” to “22:00 and 23:59”
