Code ที่ 2
หรืออีก code หนึ่ง (code นี้ จะดูสั้นกว่า ครับ) มีดังนี้.-
<SCRIPT language=javascript>
now = new Date();
var thday = new Array ("อาทิตย์","จันทร์", "อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์");
var thmonth = new Array ("มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน",
"กรกฎาคม","สิงหาคม","กันยายน",
"ตุลาคม","พฤศจิกายน","ธันวาคม");
document.write("วัน" + thday[now.getDay()]+ "ที่
"+ now.getDate()+ " " +
thmonth[now.getMonth()]+ " " + (0+now.getYear()+543));
</SCRIPT>