Thứ Hai, tháng 5 21, 2012

Hiển thị ngày tháng năm cho Blog



Bước 1. Đăng nhập Blogger
Vào  Thiết kế (Design) --> Thêm tiện ích --> chọn HTML/JavaScript
Bước 2: Chép đọan mã sau vào
<script language="" type="text/javascript">       
<!--   // Array ofmonth Names          
<!-- var monthNames = new Array("một","hai","ba","bốn","năm","sáu","bảy","tám","chín","mười","mười một","mười hai"); -->          
var monthNames = new Array("01","02","03","04","05","06","07","08","09","10","11","12");          
var dayNames = new Array("Chủ nhật,","Thứ Hai,","Thứ Ba,","Thứ tư,","Thứ Năm,","Thứ Sáu,","Thứ Bảy,")          
var now = new Date();          
thisYear = now.getYear();          
thisDay = dayNames[now.getDay()];           
if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem          
document.write("Hôm nay : " + thisDay +" "+"ngày"+" "+ now.getDate() + " tháng " + monthNames[now.getMonth()] + " năm " + thisYear);          
// -->           
</script>

Website tham khảo:
http://nguyenthinhaphuong.blogspot.com/

Không có nhận xét nào:

Đăng nhận xét