# dateArithmetic -- Hours and Minutes

**URL:** <https://forum.inductiveautomation.com/t/datearithmetic-hours-and-minutes/70753>\
**Category:** Ignition\
**Created:** [March 7, 2023, 9:28pm UTC](https://forum.inductiveautomation.com/t/datearithmetic-hours-and-minutes/70753 "2023-03-07T21:28:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neil\_Carty](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@Neil\_Carty](https://forum.inductiveautomation.com/u/Neil_Carty)\
**Post date:** [March 7, 2023, 9:28pm UTC](https://forum.inductiveautomation.com/t/datearithmetic-hours-and-minutes/70753/1 "2023-03-07T21:28:56Z")

</div>

I know i can use dateArithmetic(now(), -12, "hrs") and get what happened 12 hours ago from now but i am trying to do -12hrs and -7 mins ago. Is it possible to do this all in one expression maybe like:  
dateArithmetic(now(), -12, "hrs", -7 , "mins") It's not working for me if it is... Any suggestions. I am trying to pull a previous shifts report but i have sql tables that do not update until the end of a 12 hr shift. They want the report as close to the end of the shift as possible. I know all of my tables that i am accessing are populated by this time. I am using this as a Parameter in a sql query in the Reporting module.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [March 7, 2023, 9:36pm UTC](https://forum.inductiveautomation.com/t/datearithmetic-hours-and-minutes/70753/2 "2023-03-07T21:36:34Z")

</div>

```auto
dateArithmetic(dateArithmetic(now(), -12, "hrs"), -7, "mins")

```

I would probably just convert 12hrs and 7 min to 727 minutes though.

---

<div class="post-metadata">

**Author:** ![Neil\_Carty](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@Neil\_Carty](https://forum.inductiveautomation.com/u/Neil_Carty)\
**Post date:** [March 8, 2023, 2:54pm UTC](https://forum.inductiveautomation.com/t/datearithmetic-hours-and-minutes/70753/3 "2023-03-08T14:54:27Z")

</div>

Thank you. I was definitely over thinking that one.
