Tài liệu Code giờ có lời chào

6 294 0
Tài liệu đã được kiểm tra trùng lặp
Tài liệu Code giờ có lời chào

Đang tải... (xem toàn văn)

Thông tin tài liệu

LỜI CHÚC CỦA CHỦ NHÀ </h2> <div class="content"> <center><script type="text/javascript"> var mydate=new Date() var year=mydate.getYear() if (year < 1000) year+=1900 var day=mydate.getDay() var month=mydate.getMonth() var daym=mydate.getDate() if (daym<10) daym="0"+daym var dayarray=new Array("CHỦ NHẬT","THỨ HAI","THỨ BA","THỨ TƯ","THỨ NĂM","THỨ SÁU","THỨ BẢY") var montharray=new Array("01","02","03","04","05","06","07","08","09","10","11","12") document.write("<font color='#0066cc' face='Arial' size='2'><b>"+dayarray[day]+", "+daym+"/"+montharray[month] +"/"+year+"<\/b><\/font>") </script></center> <script language="JavaScript" type="text/javascript"> <!-- // Store the date In avarlable d = new Date() dateText = "" // Get the cuurent day and convert it to the name of the day dayValue = d.getDay() if(dayValue == 0) dateText += "Chủ Nhật" else if (dayValue == 1) dateText += "Thứ Hai" else if (dayValue == 2) dateText += "Thứ Ba" else if (dayValue == 3) dateText += "Thứ Tư" else if (dayValue == 4) dateText += "Thứ Năm" else if (dayValue == 5) dateText += "Thứ Sáu" else if (dayValue == 6) dateText += "Thứ Bảy" // Get the current date; if it's before 2000,add 1900 dateText += ", Ngày " + d.getDate()+"," // Get the current month and convert it to the name of the month monthValue = d.getMonth() dateText += " " if (monthValue == 0) dateText += "Tháng 1" if (monthValue == 1) dateText += "Tháng 2" if (monthValue == 2) dateText += "Tháng 3" if (monthValue == 3) dateText += "Tháng 4¬" if (monthValue == 4) dateText += "Tháng 5" if (monthValue == 5) dateText += "Tháng 6" if (monthValue == 6) dateText += "Tháng 7" if (monthValue == 7) dateText += "Tháng 8" if (monthValue == 8) dateText += "Tháng 9" if (monthValue == 9) dateText += "Tháng 10" if (monthValue == 10) dateText += "Tháng 11" if (monthValue == 11) dateText += "Tháng 12" // Get the current year; if it's before 2000, add 1900 if (d.getYear() < 2000) dateText += ", Năm " + (1900 + d.getYear()) else dateText += ", Năm " + (d.getYear()) // Get the current minutes minuteValue = d.getMinutes() if (minuteValue < 10) minuteValue = "0" + minuteValue // Get the current hours hourValue = d.getHours() // Customize the greeting based on the current hours if (hourValue < 6) { greeting = "<center>Chào ngày mới! <\/center>" greeting1 = "<center>Chúc các bạn một ngày mới an lành!<\/center>" } else if (hourValue < 9) { greeting = "<center>Chào buổi sáng! <\/center>" greeting1 = "<center>Chúc các bạn một buổi sáng tốt lành!<\/center>" } else if (hourValue < 11) { greeting = "<center>Sắp trưa rồi!<\/center>" greeting1 = "<center>Chúc các bạn một sáng thành công!.<\/center>" } else if (hourValue < 13) { greeting = "<center>Đã buổi trưa rồi đó!<\/center>" greeting1 = "<center>Chúc các bạn bữa trưa thật vui vẽ bên người thân!<\/center>" } else if (hourValue < 17) { greeting = "<center>Đã buổi chiều!<\/center>" greeting1 = "<center>Hãy cố gắng hoàn thành công việc còn lại trong ngày!<\/center>" } else if (hourValue < 18) { greeting = "<center>Sắp tối rồi!<\/center>" greeting1 = "<center>Chúc các bạn bữa tối thật ngon miệng, đầm ấm bên gia đình!<\/center>" } else if (hourValue <= 21) { greeting = "<center>Chào buổi tối!<\/center>" greeting1 = "<center>Chúc các bạn vui vẻ và hạnh phúc bên người thân và gia đình!<\/center>" } else { greeting = "<center>Khuya rồi đấy! <\/center>" greeting1 = "<center>Hãy đi ngủ thôi! Chúc bạn một giấc ngủ, cùng những giấc mơ đẹp!<\/center>" } // Write the greeting, the date, and the time to the page document.write(greeting +greeting1) //--> </script> </div> Hoặc đây: <font color="#ff0000"><center>Múi giờ GMT+7: Hôm nay</center></font> <center><script type="text/javascript"> var mydate=new Date() var year=mydate.getYear() if (year < 1000) year+=1900 var day=mydate.getDay() var month=mydate.getMonth() var daym=mydate.getDate() if (daym<10) daym="0"+daym var dayarray=new Array("CHỦ NHẬT","THỨ HAI","THỨ BA","THỨ TƯ","THỨ NĂM","THỨ SÁU","THỨ BẢY") var montharray=new Array("01","02","03","04","05","06","07","08","09","10","11","12") document.write("<font color='#0066cc' face='Arial' size='2'><b>"+dayarray[day]+", "+daym+" - "+montharray[month]+" - "+year+"<\/b><\/font>") </script></center> <script language="JavaScript" type="text/javascript"> <!-- // Store the date In avarlable d = new Date() dateText = "" // Get the cuurent day and convert it to the name of the day dayValue = d.getDay() if(dayValue == 0) dateText += "Chủ Nhật" else if (dayValue == 1) dateText += "Thứ Hai" else if (dayValue == 2) dateText += "Thứ Ba" else if (dayValue == 3) dateText += "Thứ Tư" else if (dayValue == 4) dateText += "Thứ Năm" else if (dayValue == 5) dateText += "Thứ Sáu" else if (dayValue == 6) dateText += "Thứ Bảy" // Get the current date; if it's before 2000,add 1900 dateText += ", Ngày " + d.getDate()+"," // Get the current month and convert it to the name of the month monthValue = d.getMonth() dateText += " " if (monthValue == 0) dateText += "Tháng 1" if (monthValue == 1) dateText += "Tháng 2" if (monthValue == 2) dateText += "Tháng 3" if (monthValue == 3) dateText += "Tháng 4¬" if (monthValue == 4) dateText += "Tháng 5" if (monthValue == 5) dateText += "Tháng 6" if (monthValue == 6) dateText += "Tháng 7" if (monthValue == 7) dateText += "Tháng 8" if (monthValue == 8) dateText += "Tháng 9" if (monthValue == 9) dateText += "Tháng 10" if (monthValue == 10) dateText += "Tháng 11" if (monthValue == 11) dateText += "Tháng 12" // Get the current year; if it's before 2000, add 1900 if (d.getYear() < 2000) dateText += ", Năm " + (1900 + d.getYear()) else dateText += ", Năm " + (d.getYear()) // Get the current minutes minuteValue = d.getMinutes() if (minuteValue < 10) minuteValue = "0" + minuteValue // Get the current hours hourValue = d.getHours() // Customize the greeting based on the current hours if (hourValue < 6) { greeting = "<center>Ngày mới đã đến! <\/center>" greeting1 = "<center>Hãy làm việc thật tốt nhé bạn!<\/center>" } else if (hourValue < 9) { greeting = "<center>Chào bạn! <\/center>" greeting1 = "<center>Chúc bạn một buổi sáng mọi việc đâu vào đấy!<\/center>" } else if (hourValue < 11) { greeting = "<center>Giờ này, bạn xong việc chưa?<\/center>" greeting1 = "<center>Mọi chuyện thế nào rồi!<\/center>" } else if (hourValue < 13) { greeting = "<center>Đã trưa! cố gắng lên bạn!<\/center>" greeting1 = "<center>Hôm nay bạn sẽ bữa trưa thật tuyệt!<\/center>" } else if (hourValue < 17) { greeting = "<center>Chiều rồi bạn ạ! Cố gắng lên nào!<\/center>" greeting1 = "<center>Gia đình và người thân đang đợi bạn đấy !<\/center>" } else if (hourValue < 18) { greeting = "<center>Chào bạn buổi tối<\/center>" greeting1 = "<center>Bạn đã dùng bữa tối chưa? Hãy giữ gìn sức khỏe nhé!<\/center>" } else if (hourValue <= 21) { greeting = "<center>Lúc này công việc của bạn sao rồi?<\/center>" greeting1 = "<center>Chúc các bạn vui vẻ và hạnh phúc bên người thân và gia đình nhé! <\/center>" } else { greeting = "<center>Giờ này đã khuya! <\/center>" greeting1 = "<center>Bạn đã chuẩn bị sắp xếp những công việc cho ngày mai chưa? Nghỉ ngơi thôi, Goodnight!<\/center>" } // Write the greeting, the date, and the time to the page document.write(greeting +greeting1) //--> </script> </div> . các bạn có bữa tối thật ngon miệng, đầm ấm bên gia đình!</center>" } else if (hourValue <= 21) { greeting = "<center> ;Chào buổi. on the current hours if (hourValue < 6) { greeting = "<center> ;Chào ngày mới! </center>" greeting1 = "<center>Chúc các

Ngày đăng: 26/11/2013, 03:11

Tài liệu cùng người dùng

Tài liệu liên quan