Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function tanggal(){
  2.     const arrBulan = ["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"];
  3.     const waktu = new Date();
  4.     const tanggal = waktu.getDate();
  5.     const tahun = waktu.getFullYear();
  6.     const bulan = waktu.getMonth();
  7.     const hari = waktu.getDay();
  8.     const jam = waktu.getHours();
  9.     const menit = waktu.getMinutes();
  10.     const detik = waktu.getSeconds();
  11.     const millisecond = waktu.getMilliseconds();
  12.     document.write(tanggal +" "+ arrBulan[bulan] +" "+ tahun +"<br>"+ jam +" : "+ menit +" : "+ detik +"."+ millisecond);
  13. }
  14. tanggal();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement