

// 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 += "Sunday"
else if (dayValue == 1)
dateText += "Monday"
else if (dayValue == 2)
dateText += "Tuesday"
else if (dayValue == 3)
dateText += "Webnesday"
else if (dayValue == 4)
dateText += "Thusday"
else if (dayValue == 5)
dateText += "Friday"
else if (dayValue == 6)
dateText += "Saturday"
// Get the current date; if it's before 2000,add 1900
dateText += "," + d.getDate()
// lấy tháng hiện tại và chuyển nó sang tháng theo tiếng Việt Nam
monthValue = d.getMonth()
dateText += ""
if (monthValue == 0)
dateText += "-01"
if (monthValue == 1)
dateText += "-02"
if (monthValue == 2)
dateText += "-03"
if (monthValue == 3)
dateText += "-04­"
if (monthValue == 4)
dateText += "-05"
if (monthValue == 5)
dateText += "-06"
if (monthValue == 6)
dateText += "-07"
if (monthValue == 7)
dateText += "-08"
if (monthValue == 8)
dateText += "-09"
if (monthValue == 9)
dateText += "-10"
if (monthValue == 10)
dateText += "-11"
if (monthValue == 11)
dateText += "-12"
// Get the current year; if it's before 2000, add 1900
if (d.getYear() < 2000)
dateText += "-" + (1900 + d.getYear())
else
dateText += "-" + (d.getYear())
// Get the current minutes
minuteValue = d.getMinutes()
if (minuteValue < 10)
minuteValue = "0" + minuteValue
// Get the current hours
hourValue = d.getHours()



// Write the greeting, the date, and the time to the page
document.write(dateText + ".")
//http://thantoc.blogspot.com


