# Best practice/way to make a Day or Night Id tag

**URL:** <https://forum.inductiveautomation.com/t/best-practice-way-to-make-a-day-or-night-id-tag/84058>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [January 10, 2024, 5:51pm UTC](https://forum.inductiveautomation.com/t/best-practice-way-to-make-a-day-or-night-id-tag/84058 "2024-01-10T17:51:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [January 10, 2024, 5:51pm UTC](https://forum.inductiveautomation.com/t/best-practice-way-to-make-a-day-or-night-id-tag/84058/1 "2024-01-10T17:51:48Z")

</div>

Good day, Im looking for the best way to make a tag that tells me is Day or Night based on a time range.

Example, if its between 8:00:00 and 20:00:00 then its Day, else its Night.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 10, 2024, 5:57pm UTC](https://forum.inductiveautomation.com/t/best-practice-way-to-make-a-day-or-night-id-tag/84058/2 "2024-01-10T17:57:50Z")

</div>

An expression tag, set to 'event driven', with an expression of:  
`timeBetween(now(1000), "8:00:00", "20:00:00")`  
I would _expect_ to work, though you may need to tweak the format of the two time constants.

[https://docs.inductiveautomation.com/display/DOC81/timeBetween](https://docs.inductiveautomation.com/display/DOC81/timeBetween)
