Cara Menampilkan Hari, Tanggal dan Jam di Blog

Login ke Blogger
Klik RancanganElemen LamanTambah GadgetHTML/JavaScript
Kemudian Copy kode Script berikut dan Paste ke dalamnya :




script type="text/javascript">
var dayarray = new Array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu");
var montharray = new Array("Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus",
"September","Oktober","November","Desember");

var myblog = new Date();

var day = myblog.getDay();
var month = myblog.getMonth();
var daym = myblog.getDate();
var year = myblog.getFullYear();

var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()

if (minutes < 10)
minutes = "0" + minutes

if (daym < 10)
daym = "0" + daym;

document.write("<b>Hari :</b>" + " " + dayarray[day] + ", " + daym + " " + montharray[month] + " " + year);
document.write(",<b> Pukul :</b>" + " " + hours + "<blink>" + " : " + "</blink>" + minutes);
document.write(" WIB");
</script>

Selamat mencoba

1 komentar:

Vicram mengatakan...

Kalau dipasang lewat edit html bagaimana gan ? Udah coba tpi ga bisa

Posting Komentar

Adsens