クリックカレンダー |
|
■<head>〜</head>内に下記を貼り付けてください。 |
<script language="JavaScript">
<!--
var b_flg = true;
var b_m_flg = true;
var b_m = 0;
function b_clock() {
var msg, hour, min, sec, year, month, day;
var date = new Date();
year = date.getYear();
month = date.getMonth() + 1;
day = date.getDate();
var browser = navigator.appName;
if (browser.indexOf("Netscape") == -1) {
year += 1900;
year += "";
}
else {
if (year < 2000) {
year += 1900;
}
year = year.toString(10);
}
year = year.substring(2, year.length);
hour = date.getHours();
if (( min = date.getMinutes() ) < 10) {
min = "0" + min;
}
if (( sec = date.getSeconds() ) < 10) {
sec = "0" + sec;
}
if (b_m == 0) {
if ((hour - 12) < 0) {
msg = "午前" + hour + "時" + min + "分" + sec
+ "秒";
}
else {
msg = "午後" + (hour-12) + "時" + min + "分"
+ sec + "秒";
}
}
else if (b_m == 1) {
msg = year + "年" + month + "月" + day + "日";
}
else {
msg = "error!";
}
b_m_flg = true;
if (b_flg) {
document.write('<FORM NAME=b_clock_form><INPUT TYPE=button NAME=time
VALUE=" " onClick="b_clock_mode()"></FORM>');
b_flg = false;
}
document.b_clock_form.time.value = msg;
setTimeout("b_clock()", 200);
}
function b_clock_mode() {
if (b_m_flg) {
if (b_m < 1) {
b_m++
}
else {
b_m = 0;
}
b_m_flg = false;
}
else {
return;
}
}
// -->
</script> |
■<body>〜</body>内に下記を貼り付けてください。 |
<script language="JavaScript">
<!--
b_clock();
-->
</script> |
|