Need help with a clock system

So for school I’m building a hallway pass system where you are able to fill out the pass during certain times. The problem I’m having is finding a way so during the times you aren’t able to fill it out, it shoots an error. I would really like help with this, please let me know if anyone has any solutions!

Theoretically, it’s very simple. Just start a variable with a value of 0 and save this variable with a value of 1 when the error occurs and 0 when it is ok. Now the error method depends on how your system is registering the event.

Thank you for the insight, but the main issue is like this: I can get the device time, but I need for a certain time to be unavailable. So let’s say you are allowed to go to the bathroom during 9:30-9:40 am, but you try to fill out the pass at 9:20. I need to be able to make it so the pass is not able to be filled out. You get what I’m saying?

I understood. I recently had a similar problem with this calculation involving dates and times. I managed to solve it by removing the separators, joining and solving as an integer value. It’s much easier to calculate this way. Ex: 09:50 = 0950. IF $data < 0930 OR $data > 0940 = false. I think this should work.

image

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.