26/7/10

Nhúng ngày tháng năm bằng tiếng việt:

<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>

DEMO

0 nhận xét:

:)) ;)) ;;) :D ;) :p :(( :) :( :X
=(( :-o :-/ :-* :| 8-} :)] :-t b-( :-L

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.

Home | Forum | JavaScript | Services | Submit script | Documentary | Contact us | About us