via PHP date funktion:

PHP-Code:
if(date('G')>19 && date('G') < 6){
//nacht
}else{
//tag