﻿
// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array('星期天','星期一','星期二','星期三','星期四','星期五','星期六');

// Array list of months.
var months = new Array('1','2','3','4','5','6','7','8','9','10','11','12');

// Calculate the number of the current day in the week.
var nowdate = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
								}

// Join it all together
today =  (fourdigits(now.getYear())) + "年" + 
					months[now.getMonth()] + "月" + 
					nowdate + "日 " + days[now.getDay()] ;
// Print out the data.
document.write("" +today);
//  End -->

