I want something that seems simple but can't figure out :
I have an integer which in my program is an hour, in a 24h format (ie '18') and I want to add X (ie '7') hours to it.
How do I add hours to something that is not at date object whatsoever. Something that would work like this :
18 + 7 = 1
Using the modulus operator is what you're after. See this example:
echo ((18 + 7) % 24); // Output: 1