// JavaScript Document
tz_nz = 13 * 60; // ニュージーランドの夏時間はGMT+13
tz_uk = 0; // イギリスはGMTですね。 
tz_jp = 9 * 60; // GMT+9

var nz, uk, jp; // 時刻文字列を入れるところ  

function update_watch() {
	now = new Date();
	jp = nowat(now, tz_jp);

	$("#time").text(jp);

	setTimeout('update_watch()', 999); // 1000msec = 1sec
}

function nowat(now, tz) {
	var year,month, day, hour, min, sec;
	var t = new Date();
	t.setTime(now.getTime() + (now.getTimezoneOffset() + tz) * 60 * 1000);
	year = t.getFullYear();
	month = t.getMonth() + 1;
	day = t.getDate();
	hour = t.getHours();
	min = t.getMinutes();
	sec = t.getSeconds();
	if (hour < 10) {
		hour = "0" + hour;
	}
	if (min < 10) {
		min = "0" + min;
	}
	/*
	if (sec < 10) {
		sec = "0" + sec;
	}
	return hour + ":" + min + ":" + sec; 
	*/
	return month + "/" + day + "/" + year + " " + hour + ":" + min;
}
update_watch();

