# Adding time to another tag

**URL:** <https://forum.inductiveautomation.com/t/adding-time-to-another-tag/97631>\
**Category:** Ignition\
**Created:** [October 22, 2024, 6:21pm UTC](https://forum.inductiveautomation.com/t/adding-time-to-another-tag/97631 "2024-10-22T18:21:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_melcher](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jason\_melcher](https://forum.inductiveautomation.com/u/jason_melcher)\
**Post date:** [October 22, 2024, 6:21pm UTC](https://forum.inductiveautomation.com/t/adding-time-to-another-tag/97631/1 "2024-10-22T18:21:57Z")

</div>

I have a memory tag "Shift1\_start" that can be changed daily but I want another event to happen 15 seconds before that tag set time.

The issue I am having is getting the expression in my "newStartTime" expression tag to work.

I got it to work in a custom property by using addseconds({value}, 15) but I cant figure out how to tie that back to another tag.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/6/865a3ecdf550fd6508cb95e67c697b9a46bf4045.png)

I am having trouble getting the syntax right in an expression to add 15 seconds to "Start\_Time"

Thanks for any help

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [October 22, 2024, 7:01pm UTC](https://forum.inductiveautomation.com/t/adding-time-to-another-tag/97631/2 "2024-10-22T19:01:25Z")

</div>

The screenshot you've provided is from your custom property that's working as you intended?  
Have you tried changing your expression tag "newStartTime" to

```python
addseconds({insertPathToShift1_startHere}, 15)

```

---

<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:** [October 22, 2024, 7:21pm UTC](https://forum.inductiveautomation.com/t/adding-time-to-another-tag/97631/3 "2024-10-22T19:21:49Z")

</div>

An expression binding without a transform is all you need (as well as negative seconds).  
`addSeconds({./Shift1_start.custom.shift1_start}, -15)`

* * *

Tip: don't crop the header off the binding dialog when posting. It shows the name of the component and property to which the binding will be applied and this is very useful in understanding where your binding is being applied.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 22, 2024, 8:02pm UTC](https://forum.inductiveautomation.com/t/adding-time-to-another-tag/97631/4 "2024-10-22T20:02:13Z")

</div>

> [@jason\_melcher](#):
>
> but I want another event to happen 15 seconds before that tag set time

What is the event meant to do? If you're doing this inside a View, then this won't run if a client isn't connected, and will run for every client that is. Is that what you want?

If not, you want to be using a gateway scoped event like a tag value change event, or a gw tag change event

---

<div class="post-metadata">

**Author:** ![jason\_melcher](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jason\_melcher](https://forum.inductiveautomation.com/u/jason_melcher)\
**Post date:** [October 23, 2024, 1:35am UTC](https://forum.inductiveautomation.com/t/adding-time-to-another-tag/97631/5 "2024-10-23T01:35:44Z")

</div>

This is exactly what I was looking for. I was just doing the syntax incorrectly.

Thank you!

---

<div class="post-metadata">

**Author:** ![jason\_melcher](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jason\_melcher](https://forum.inductiveautomation.com/u/jason_melcher)\
**Post date:** [October 23, 2024, 1:37am UTC](https://forum.inductiveautomation.com/t/adding-time-to-another-tag/97631/6 "2024-10-23T01:37:01Z")

</div>

I was looking to take a memory tag with a date / Time in it and create another memory tag that was 15 seconds earlier. Both tags are in a gateway script, I just couldn't get that syntax to work for some reason

---

<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:** [October 23, 2024, 7:00am UTC](https://forum.inductiveautomation.com/t/adding-time-to-another-tag/97631/7 "2024-10-23T07:00:35Z")

</div>

Hmmm, it sounds as though you have failed to get something to reset in the right sequence on shift reset so you are applying a workaround by doing it 15 s early in the hope that 15 s is enough time to ensure that it will always work. If that's the case then you're hiding a problem somewhere.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 23, 2024, 11:38am UTC](https://forum.inductiveautomation.com/t/adding-time-to-another-tag/97631/8 "2024-10-23T11:38:16Z")

</div>

> [@jason\_melcher](#):
>
> create another memory tag that was 15 seconds earlier

That wouldn't be a memory tag, but an expression tag.
