function hour_switvh($hour)
{
        $hour=$hour/2;
        if($hour==0.0){$hour="00:00";}
        if($hour==0.5){$hour="00:30";}
        if($hour==1.0){$hour="01:00";}
        if($hour==1.5){$hour="01:30";}
        if($hour==2.0){$hour="02:00";}
        if($hour==2.5){$hour="02:30";}
        if($hour==3.0){$hour="03:00";}
        if($hour==3.5){$hour="03:30";}
        if($hour==4.0){$hour="04:00";}
        if($hour==4.5){$hour="04:30";}
        if($hour==5.0){$hour="05:00";}
        if($hour==5.5){$hour="05:30";}
        if($hour==6.0){$hour="06:00";}
        if($hour==6.5){$hour="06:30";}
        if($hour==7.0){$hour="07:00";}
        if($hour==7.5){$hour="07:30";}
        if($hour==8.0){$hour="08:00";}
        if($hour==8.5){$hour="08:30";}
        if($hour==9.0){$hour="09:00";}
        if($hour==9.5){$hour="09:30";}
        if($hour==10.0){$hour="10:00";}
        if($hour==10.5){$hour="10:30";}
        if($hour==11.0){$hour="11:00";}
        if($hour==11.5){$hour="11:30";}
        if($hour==12.0){$hour="12:00";}
        if($hour==12.5){$hour="12:30";}
        if($hour==13.0){$hour="13:00";}
        if($hour==13.5){$hour="13:30";}
        if($hour==14.0){$hour="14:00";}
        if($hour==14.5){$hour="14:30";}
        if($hour==15.0){$hour="15:00";}
        if($hour==15.5){$hour="15:30";}
        if($hour==16.0){$hour="16:00";}
        if($hour==16.5){$hour="16:30";}
        if($hour==17.0){$hour="17:00";}
        if($hour==17.5){$hour="17:30";}
        if($hour==18.0){$hour="18:00";}
        if($hour==18.5){$hour="18:30";}
        if($hour==19.0){$hour="19:00";}
        if($hour==19.5){$hour="19:30";}
        if($hour==20.0){$hour="20:00";}
        if($hour==20.5){$hour="20:30";}
        if($hour==21.0){$hour="21:00";}
        if($hour==21.5){$hour="21:30";}
        if($hour==22.0){$hour="22:00";}
        if($hour==22.5){$hour="22:30";}
        if($hour==23.0){$hour="23:00";}
        if($hour==23.5){$hour="23:30";}
        if($hour==24.0){$hour="24:00";}

        return $hour;
}

added by dfj

By feri, 2017-12-13 11:15:02