# Pop Up Window using Time of Day

**URL:** <https://forum.inductiveautomation.com/t/pop-up-window-using-time-of-day/34362>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [May 1, 2020, 6:19pm UTC](https://forum.inductiveautomation.com/t/pop-up-window-using-time-of-day/34362 "2020-05-01T18:19:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [May 1, 2020, 6:19pm UTC](https://forum.inductiveautomation.com/t/pop-up-window-using-time-of-day/34362/1 "2020-05-01T18:19:53Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/465700d071243ae88661201df97c2ea89f897b30.png)  
Hello. I have a Pop-Up window that I would like to Pop Up at 05:30 and 17:30. In the script editor, I have started to use dateDiff but am having some difficulty understanding the Instruction. New to scriptiing.

Also wondered if there is an easier way to accomplish this what seems to be an “Easy Task” LOL

Open to help, suggestions, and options

Thanks in advance…

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [May 1, 2020, 8:56pm UTC](https://forum.inductiveautomation.com/t/pop-up-window-using-time-of-day/34362/2 "2020-05-01T20:56:14Z")

</div>

It you want something to happen at a certain time of day one method is to add an expression tag with the following expression:

`dateFormat({[System]Gateway/CurrentDateTime},"HHmm") = "1018"`

Then create a Client Tag Change Event Script that opens your popup when the expression tag becomes true.

---

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [May 4, 2020, 5:43pm UTC](https://forum.inductiveautomation.com/t/pop-up-window-using-time-of-day/34362/3 "2020-05-04T17:43:57Z")

</div>

Hi Brandon… I have tried what you suggested but still cannot get the pop up to occur. The Expression tag is working properly but the pop up will not display… Attached is the Expression and Tag Event code that reside in the Expression Tag. What am I doing wrong?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/14b6174fa558ee41c492165b64f74d62d6a240e7.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7340716f126a5db8c6fee083a8bb72cc2aff8312.png)

---

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [May 4, 2020, 6:49pm UTC](https://forum.inductiveautomation.com/t/pop-up-window-using-time-of-day/34362/4 "2020-05-04T18:49:12Z")

</div>

I doubt that the gateway tag events has an access to gui windows.

You would probably have to do something like:  
Add your expression tag like:

```auto
dateFormat(now(), 'HHmm') = '0530' || dateFormat(now(), 'HHmm') = '1730'

```

Create a Client Tag Change Event script :

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/3c4873f8bd7ab007cdadc0261a91d1ec505dda25.png)

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [May 4, 2020, 6:52pm UTC](https://forum.inductiveautomation.com/t/pop-up-window-using-time-of-day/34362/5 "2020-05-04T18:52:31Z")

</div>

Yeah what @kaushik.shah said.

---

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [May 4, 2020, 7:02pm UTC](https://forum.inductiveautomation.com/t/pop-up-window-using-time-of-day/34362/6 "2020-05-04T19:02:47Z")

</div>

OK. So I will modify my Expression Tag Expression to reflect  
‘’‘dateFormat(now(), ‘HHmm’) = ‘0530’ || dateFormat(now(), ‘HHmm’) = ‘1730’’’’  
and  
Add the Client Tag Script as shown above. I would then change ‘Popup’ to my Pop Up Name?

Sorry for my lack of this knowledge. I have planned training at IA when all is well in the world…

---

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [May 4, 2020, 7:12pm UTC](https://forum.inductiveautomation.com/t/pop-up-window-using-time-of-day/34362/7 "2020-05-04T19:12:38Z")

</div>

Yes, Client Event script will have window path to your popup.  
Example,  
If it’s located inside a folder called popups  
then ‘Popups/popup’

---

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [May 4, 2020, 8:02pm UTC](https://forum.inductiveautomation.com/t/pop-up-window-using-time-of-day/34362/8 "2020-05-04T20:02:47Z")

</div>

Thank you for your help. I was able to use ‘’‘dateFormat({[System]Gateway/CurrentDateTime},“HHmm”)’’’ in my system because it is a stand alone gateway at this time.

Thanks again for the help from both of you… Much Appreciated.
