# Gatway Event Scripts Changing Time Executing

**URL:** <https://forum.inductiveautomation.com/t/gatway-event-scripts-changing-time-executing/20074>\
**Category:** General Discussion\
**Tags:** ignition79\
**Created:** [October 10, 2018, 7:55pm UTC](https://forum.inductiveautomation.com/t/gatway-event-scripts-changing-time-executing/20074 "2018-10-10T19:55:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ismael.oribeiro](https://avatars.discourse-cdn.com/v4/letter/i/9de0a6/32.png) [@ismael.oribeiro](https://forum.inductiveautomation.com/u/ismael.oribeiro)\
**Post date:** [October 10, 2018, 7:55pm UTC](https://forum.inductiveautomation.com/t/gatway-event-scripts-changing-time-executing/20074/1 "2018-10-10T19:55:57Z")

</div>

Hey friends,

I’m facing a problema, I’ve create a Gateway event script in a project to execute each 43,200,000 ms (12 hours). It works for some days. Strangely after some days the execution time changes, the problem is that I need a fixed hour to run this function, you can look in the below log the generating times.  
18-10-03 01:16:24 - Generating…  
18-10-03 01:16:24 - Generating…  
18-10-03 13:16:24 - Generating…  
18-10-03 13:16:24 - Generating…  
18-10-04 01:16:24 - Generating…  
18-10-04 01:16:24 - Generating…  
18-10-04 13:16:24 - Generating…  
18-10-04 13:16:24 - Generating…  
18-10-05 01:16:24 - Generating…  
18-10-05 01:16:24 - Generating…  
18-10-05 21:39:18 - Generating…  
18-10-05 21:39:18 - Generating…  
18-10-06 09:39:18 - Generating…  
18-10-06 09:39:18 - Generating…  
18-10-06 21:39:18 - Generating…  
18-10-06 21:39:18 - Generating…  
18-10-07 09:39:18 - Generating…  
18-10-07 09:39:18 - Generating…  
18-10-07 21:39:18 - Generating…  
18-10-07 21:39:18 - Generating…  
18-10-08 09:39:18 - Generating…  
18-10-08 09:39:18 - Generating…  
18-10-08 14:01:35 - Generating…  
18-10-08 14:01:38 - Generating…  
18-10-09 02:06:41 - Generating…  
18-10-09 02:06:41 - Generating…  
18-10-09 14:06:41 - Generating…  
18-10-09 14:06:41 - Generating…  
18-10-10 02:38:24 - Generating…  
18-10-10 02:38:24 - Generating…  
18-10-10 14:38:24 - Generating…  
18-10-10 14:38:24 - Generating…

The time change vary.

Could someone help me with this issue?

Thank you very much!

---

<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 11, 2018, 1:57am UTC](https://forum.inductiveautomation.com/t/gatway-event-scripts-changing-time-executing/20074/2 "2018-10-11T01:57:19Z")

</div>

Check out this recent discussion of a similar requirement:

> [@Gateway Script Only at 4pm](http://forum.inductiveautomation.com/t/gateway-script-only-at-4pm/19979):
>
> How can I set up a gateway script to run once at 4pm everyday? I want to write a value to a single tag at this time. thanks

---

<div class="post-metadata">

**Author:** ![ismael.oribeiro](https://avatars.discourse-cdn.com/v4/letter/i/9de0a6/32.png) [@ismael.oribeiro](https://forum.inductiveautomation.com/u/ismael.oribeiro)\
**Post date:** [October 11, 2018, 11:28am UTC](https://forum.inductiveautomation.com/t/gatway-event-scripts-changing-time-executing/20074/3 "2018-10-11T11:28:47Z")

</div>

You can start it at 4 PM, the lapse could be 86400000 ms (24h). Use the Fixed Rate property.

Thanks!

---

<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 11, 2018, 11:31am UTC](https://forum.inductiveautomation.com/t/gatway-event-scripts-changing-time-executing/20074/4 "2018-10-11T11:31:51Z")

</div>

> [@ismael.oribeiro](#):
>
> You can start it at 4 PM, the lapse could be 86400000 ms (24h). Use the Fixed Rate property.

There's no way to "start" a timer event at a particular time. The interval starts when the gateway starts up. As you've noted, events can be missed or delayed. You need a different approach, like the solution I linked, which could be adapted to your case.

---

<div class="post-metadata">

**Author:** ![ismael.oribeiro](https://avatars.discourse-cdn.com/v4/letter/i/9de0a6/32.png) [@ismael.oribeiro](https://forum.inductiveautomation.com/u/ismael.oribeiro)\
**Post date:** [October 11, 2018, 11:44am UTC](https://forum.inductiveautomation.com/t/gatway-event-scripts-changing-time-executing/20074/5 "2018-10-11T11:44:24Z")

</div>

Great!

Thank you very much!
