# Count seconds since start with reset condition and use the value within vision

**URL:** <https://forum.inductiveautomation.com/t/count-seconds-since-start-with-reset-condition-and-use-the-value-within-vision/62400>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [July 28, 2022, 9:53am UTC](https://forum.inductiveautomation.com/t/count-seconds-since-start-with-reset-condition-and-use-the-value-within-vision/62400 "2022-07-28T09:53:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eike\_Saathoff](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@Eike\_Saathoff](https://forum.inductiveautomation.com/u/Eike_Saathoff)\
**Post date:** [July 28, 2022, 9:53am UTC](https://forum.inductiveautomation.com/t/count-seconds-since-start-with-reset-condition-and-use-the-value-within-vision/62400/1 "2022-07-28T09:53:59Z")

</div>

Hi together,

I want to count the seconds since shift start (daily 6am / 2pm / 10 pm).

My thought was using a transaction group with a tag and hour meter and use a variable that changes its value 6am/2pm/10pm to reset the hour meter (reset condition).Do I have to constantly query the database for the stored value of the hour meter or is there a possibility to grab the value directly from the transaction group tag?

Or is there another simpler possibility to count seconds since starting timestamp to use this value in vision? I want to multiply the value of seconds with the production rate per minute to get a theoretical production value (target production).

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 28, 2022, 12:19pm UTC](https://forum.inductiveautomation.com/t/count-seconds-since-start-with-reset-condition-and-use-the-value-within-vision/62400/2 "2022-07-28T12:19:15Z")

</div>

You can use a gateway scheduled script to read a starting timestamp tag, and calculate the seconds past and other logic at your specific times.

```auto
now = system.date.now()
system.date.secondsBetween(startTime,now)

```

Or if you want more of a real time progress you could use an expression tag using your start tag.

```auto
secondsBetween({[.]start},now())

```

which can be used in a gateway scheduled script, transaction group, or another expression tag.
