Código Javascript
:
Ver originalfunction diaSemana(valor) {
var now = new Date();
var sDia;
var day = now.getDay();
var hours = now.getHours();
/**
* Imprime: 0->domingo | 6->sabado
*/
switch (day) {
case 0:
sDia = 'domingo';
break;
case 1:
sDia = 'lunes';
break;
case 2:
sDia = 'martes';
break;
case 3:
sDia = 'miércoles';
break;
case 4:
sDia = 'jueves';
break;
case 5:
sDia = 'viernes';
break;
default:
sDia = 'sábado';
break;
}
if ((hours >= 0) && (hours < 6))
txthello = "MADRUGADA";
if ((hours >= 6) && (hours < 21))
txthello = "DIA";
if ((hours >= 21) && (hours < 0))
txthello = "NOCHE";
document.write(sDia + ': ' + hours + 'hs' + ' ' + txthello);
}