# Finding what the current work Shift is and when it started, 4x 12 hour shifts

**URL:** <https://forum.inductiveautomation.com/t/finding-what-the-current-work-shift-is-and-when-it-started-4x-12-hour-shifts/76458>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [July 17, 2023, 2:42pm UTC](https://forum.inductiveautomation.com/t/finding-what-the-current-work-shift-is-and-when-it-started-4x-12-hour-shifts/76458 "2023-07-17T14:42:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [July 17, 2023, 2:53pm UTC](https://forum.inductiveautomation.com/t/finding-what-the-current-work-shift-is-and-when-it-started-4x-12-hour-shifts/76458/2 "2023-07-17T14:53:26Z")

</div>

This may be overkill for what you need, but I'm a big fan of the system that @pturmel shared in this post:

> [@Script for periodically changing shift time](https://forum.inductiveautomation.com/t/script-for-periodically-changing-shift-time/51058/3):
>
> Hi Berkay, I like to solve this kind of problem with a smart database, like PostgreSQL, where I can define a pattern and repeat it with table generating functions. I tweaked one of my implementations to serve as an example: create table shift\_schedules (shift\_id serial, shift\_name varchar(255), refdate date, repeat int, tzname varchar(255), primary key (shift\_id)); insert into shift\_schedules (shift\_name, refdate, repeat, tzname) values ('Berkay Cinar 3wk', '2021-07-26', 21, 'America/Ne…

---

_[View the full topic](https://forum.inductiveautomation.com/t/finding-what-the-current-work-shift-is-and-when-it-started-4x-12-hour-shifts/76458)._
