# Script scheduled

**URL:** <https://forum.inductiveautomation.com/t/script-scheduled/10631>\
**Category:** Ignition\
**Created:** [October 16, 2015, 7:09am UTC](https://forum.inductiveautomation.com/t/script-scheduled/10631 "2015-10-16T07:09:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea.montresor](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@andrea.montresor](https://forum.inductiveautomation.com/u/andrea.montresor)\
**Post date:** [October 16, 2015, 7:09am UTC](https://forum.inductiveautomation.com/t/script-scheduled/10631/1 "2015-10-16T07:09:26Z")

</div>

Hi,

is it possible to run a Phyton Script scheduled every day at 10.00 AM?  
I tried with “Gateway timer Scripts” but i want a specific time to run the script.  
Where I can put this script? How can I solve it?

Thanks,  
Andrea

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [October 16, 2015, 8:00am UTC](https://forum.inductiveautomation.com/t/script-scheduled/10631/2 "2015-10-16T08:00:49Z")

</div>

I think the simplest thing to do would be to write a gateway timer script to run every minute. The first thing the script would do is check the time. If it wasn’t 10:00 it would exit. If it was 10:00 it would run your code.

To make sure your code isn’t run more than once, you could set a flag when your code is run and only clear this flag when the time is not 10:00. You would then check that the time is 10:00 and the flag is not set before running your code.

Jordan also described an interesting method using an expression tag in [this post](https://inductiveautomation.com/forum/viewtopic.php?f=70&t=14144&p=51620&hilit=current+time#p51620).

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [October 16, 2015, 4:08pm UTC](https://forum.inductiveautomation.com/t/script-scheduled/10631/3 "2015-10-16T16:08:15Z")

</div>

Create a Gateway timer script that runs every second, and you can use the following code -

[code]from time import localtime, strftime  
curTime = strftime("%H:%M:%S", localtime())

if curTime == “10:00:00”:  
#your code goes here[/code]
