Or if you are really only on the hour, use the byte hour value @Juraj picks out of the tm struct.
Then you need an "or" test on the 24 hour value, if the hour is greater than or equal to 21 gets you to midnight OR if the hour is less than 6 gets you to dawn.
or
you could also say if the hour is less than 21 AND greater than or equal to 6.
It is never too soon to discover and look into
De Morgan's Theorem
I leave the googling to you.
a7