1) Give a description of the problem
I’m trying to figure out how to get a value for the amount of time that has passed between two events. In my case door unlock and lock
2) What is the expected behavior?
I’d like to know how long it has been from the time a door us unlocked to the time it gets locked again. Although the logic could be used for pretty much anything, I guess. How long did I leave the window open, how long was a light on, How long was the TV on, etc
I’ve managed to get a time stamp to a variable, but don’t know how to convert the numbers to something like
3 hours and 15 minutes. For this example I will be sending myself a text message when the door is locked of how long it was unlocked.