# dateArithmetic vs. setTime

**URL:** <https://forum.inductiveautomation.com/t/datearithmetic-vs-settime/99748>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [December 12, 2024, 1:45pm UTC](https://forum.inductiveautomation.com/t/datearithmetic-vs-settime/99748 "2024-12-12T13:45:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahawes](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ahawes/32/36337_2.png) [@ahawes](https://forum.inductiveautomation.com/u/ahawes)\
**Post date:** [December 12, 2024, 1:45pm UTC](https://forum.inductiveautomation.com/t/datearithmetic-vs-settime/99748/1 "2024-12-12T13:45:19Z")

</div>

Good morning Team,

I am working on a time series chart with a startDate and endDate buttons to allow end users to select a date range but they also start at specifc times.

The dateArithmetic is set to show the last 2 hours when the popup is selected. This way also allows users to select a date range and it will show and allow export.

The setTime starts at 5:30 am when the popup is selected. The issue is that when a date range is selected it will quickly show the new selected date but then fall back to the 5:30 am.

I am assuming the difference between the two time sets are the difference.

Anyone have any ideas to resolve?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2bf5f60f629441570c3c7405cae4afe560956a29.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/2/22fa6df1a908cca3972e9cc9524581ea3fb5b576.png)

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [December 12, 2024, 1:47pm UTC](https://forum.inductiveautomation.com/t/datearithmetic-vs-settime/99748/2 "2024-12-12T13:47:36Z")

</div>

You are missing the (0) in the set time version of now()  
Without the 0, it will keep firing.

---

<div class="post-metadata">

**Author:** ![ahawes](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ahawes/32/36337_2.png) [@ahawes](https://forum.inductiveautomation.com/u/ahawes)\
**Post date:** [December 12, 2024, 2:08pm UTC](https://forum.inductiveautomation.com/t/datearithmetic-vs-settime/99748/3 "2024-12-12T14:08:09Z")

</div>

Awesome, thanks for helping.

I am learning as i go 🙂

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [December 12, 2024, 5:14pm UTC](https://forum.inductiveautomation.com/t/datearithmetic-vs-settime/99748/4 "2024-12-12T17:14:52Z")

</div>

`now()` fires at the default scan rate - typically 1000 ms.  
`now(0)` fires once on load.  
`now(1234)` fires once every 1234 ms.
