Sabtu, 17 April 2010

Logic detik2


#body>

#script>

var d=new Date();

hari=new Array(7);

hari[0]="Minggu";

hari[1]="Senin";

hari[2]="Selasa";

hari[3]="Rabu";

hari[4]="Kamis";

hari[5]="Jumat";

hari[6]="Sabtu";

bulan=new Array(12);

bulan[0]="Januari";

bulan[1]="Februari";

bulan[2]="Maret";

bulan[3]="April";

bulan[4]="Mei";

bulan[5]="Juni";

bulan[6]="Juli";

bulan[7]="Agustus";

bulan[8]="September";

bulan[9]="Oktober";

bulan[10]="November";

bulan[11]="Desember";

var d=new Date();

a=d.getHours();

b=d.getMinutes();

c=d.getSeconds();

if (a#10){

document.write("#b>selamat pagi #/b>sekarang hari "+hari[d.getDay()]+" "+d.getDate()+" "+bulan[d.getMonth()]+" "+d.getFullYear());

}

else if (a>11 && a#15){

document.write("#b>selamat siang #/b>sekarang hari "+hari[d.getDay()].toUpperCase()+" "+d.getDate()+" "+bulan[d.getMonth()].toUpperCase()+" "+d.getFullYear());

}

else if (a>16 && a#18){

document.write("#b>selamat sore #/b>sekarang hari "+hari[d.getDay()]+d.getDate()+bulan[d.getMonth()]+d.getFullYear());

}

else

{document.write("#b>selamat malam #/b>sekarang hari "+hari[d.getDay()]+" "+d.getDate()+" "+bulan[d.getMonth()]+" "+d.getFullYear());

}

thn=d.getFullYears();

//jam=d.getHours();

/*document.write(hari[d.getDay()]);

document.write("#br/>");

document.write(d.getDay());*/

//document.write(bulan[d.getMonth()]);

//document.write("#br/>");

//document.write(d.getMonth());

#/script>

#/body>