I am trying to normalize the day time of Minecraft. There are 24000 ticks per in game day, so I can chop of the trailing zeros. But the issue is, that 18000 is midnight, which doesn't make sense. So I want to have midnight as 0.
| standard | normalized |
|---|---|
| 0 | 6 |
| 1 | 7 |
| 2 | 8 |
| 3 | 9 |
| 4 | 10 |
| 5 | 11 |
| 6 | 12 |
| 7 | 13 |
| 8 | 14 |
| 9 | 15 |
| 10 | 16 |
| 11 | 17 |
| 12 | 18 |
| 13 | 19 |
| 14 | 20 |
| 15 | 21 |
| 16 | 22 |
| 17 | 23 |
| 18 | 0 |
| 19 | 1 |
| 20 | 2 |
| 21 | 3 |
| 22 | 4 |
| 23 | 5 |
My first attempt was just to add 24-18, so 6 to it. I realized my error when the clock reached 24 and kept going.
I thought I could to something with modulo, but checking the numbers don't get me to the answer. Is there any easy mathematical way to add, substract or divite the values, so that I get the normalized time? (Sorry if normalized is not the correct term!)