Hola
davizco
Prueba este código a ver si es lo que buscas. Me ha funcionado en IE y Firefox:
Código PHP:
<html>
<head>
<script>
function ini() {
fec=new Date();
h = fec.getHours();
foto = (h>8 && h<20) ? 'dia.jpg' : 'noche.jpg';
document.getElementById('imagen').src = foto;
}
</script>
</head>
<body onload="ini()">
<img id="imagen" />
</body>
</html>
Saludos,