# timeBetween() expression example?

**URL:** <https://forum.inductiveautomation.com/t/timebetween-expression-example/3495>\
**Category:** Ignition\
**Created:** [October 26, 2011, 3:28pm UTC](https://forum.inductiveautomation.com/t/timebetween-expression-example/3495 "2011-10-26T15:28:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@Justin](https://forum.inductiveautomation.com/u/Justin)\
**Post date:** [October 26, 2011, 3:28pm UTC](https://forum.inductiveautomation.com/t/timebetween-expression-example/3495/1 "2011-10-26T15:28:09Z")

</div>

Checking to see if someone can help me with an expression. I need an item in a transaction group to become true between 5:00 and 15:30. What would be the best way to handle this. If you have a full example, that will help. Thanks.

---

<div class="post-metadata">

**Author:** ![Duffanator](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/duffanator/32/3560_2.png) [@Duffanator](https://forum.inductiveautomation.com/u/Duffanator)\
**Post date:** [October 26, 2011, 3:50pm UTC](https://forum.inductiveautomation.com/t/timebetween-expression-example/3495/2 "2011-10-26T15:50:00Z")

</div>

Here is a piece of code I use in the alerting groups section to only send alarms to second shift people when an alarm happens between their start time and end time:

```auto
{[SEVERITY]} = 4 && timeBetween(dateFormat(now(), "h:mm a"), "2:30 PM", "10:30 PM")
```

Is that what you’re looking for?

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [October 26, 2011, 3:52pm UTC](https://forum.inductiveautomation.com/t/timebetween-expression-example/3495/3 "2011-10-26T15:52:23Z")

</div>

Here is an example from the [User Manual](http://localhost:8088/main/system/help/gen_date_and_time_timebetween.htm)
