Most efficent way to adjust value
Instead of comparing, you can use the modulo operator:

 secondStartHour = (startHour +  6) % 24;


And similar for the others:

 thirdStartHour  = (startHour + 12) % 24;
 fourthStartHour = (startHour + 18) % 24;


While xxxStartHour >= 24, 24 will be removed until it is within range [0, 24).

If you need an offset, you also can add some hours of course after the module (I don't fully understand your example which can have values >= 24.

Also, if you need to do the same task every 6 hours, you can use with one time and 'restart' it every 6 hours (and maybe taking summer/winter time into account).