# How to determine gateway startup and shutdown times?

**URL:** <https://forum.inductiveautomation.com/t/how-to-determine-gateway-startup-and-shutdown-times/57186>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 15, 2022, 3:37am UTC](https://forum.inductiveautomation.com/t/how-to-determine-gateway-startup-and-shutdown-times/57186 "2022-03-15T03:37:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elijah.puga](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/elijah.puga/32/23091_2.png) [@elijah.puga](https://forum.inductiveautomation.com/u/elijah.puga)\
**Post date:** [March 15, 2022, 3:37am UTC](https://forum.inductiveautomation.com/t/how-to-determine-gateway-startup-and-shutdown-times/57186/1 "2022-03-15T03:37:13Z")

</div>

Does Ignition have a functionality to determine the datetime of gateway startup and shutdown?

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [March 15, 2022, 3:51am UTC](https://forum.inductiveautomation.com/t/how-to-determine-gateway-startup-and-shutdown-times/57186/2 "2022-03-15T03:51:05Z")

</div>

There is a system gateway tag called UptimeSeconds which you can use to infer the startup time. The shutdown time you could approximate as when the uptime was 0 i suppose.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [March 15, 2022, 11:07am UTC](https://forum.inductiveautomation.com/t/how-to-determine-gateway-startup-and-shutdown-times/57186/3 "2022-03-15T11:07:50Z")

</div>

You could also log to a db table using gateway startup and shutdown events.

![Screenshot from 2022-03-15 07-03-34](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/e/5e1df265bce29e721cfc265cf08d87e20ced05c4.png)

---

<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:** [March 15, 2022, 3:13pm UTC](https://forum.inductiveautomation.com/t/how-to-determine-gateway-startup-and-shutdown-times/57186/4 "2022-03-15T15:13:23Z")

</div>

> [@JordanCClark](#):
>
> using gateway startup and shutdown events.

Except the startup script re-runs every time you edit its project....

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 15, 2022, 3:14pm UTC](https://forum.inductiveautomation.com/t/how-to-determine-gateway-startup-and-shutdown-times/57186/5 "2022-03-15T15:14:20Z")

</div>

You can ask the JVM for it’s start time directly:

> <https://stackoverflow.com/questions/817801/time-since-jvm-started/817835#817835>
