﻿// JScript 文件

 
calendar1 = new Date();
day = calendar1.getDay();
month = calendar1.getMonth() + 1;
date = calendar1.getDate();
year = calendar1.getYear();
if (year< 100) year = 1900 + year;
cent = parseInt(year/100);
g = year % 19;
k = parseInt((cent - 17)/25);
i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
l = i - j;
emonth = 3 + parseInt((l + 40)/44); 
edate = l + 28 - 31*parseInt((emonth/4));
emonth--;
var dayname = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var monthname =
new Array ("January","February","March","April","May","June","July","August","September","October","November","December" );







document.write(date + "-");
document.write(month +" " + "-");
document.write(""+year + "&nbsp;&nbsp;");
document.write("<span id='clock'></span>"); 
function showtime(){
var clock =document.getElementById('clock');
 
now = new Date(); 
hours = now.getHours(); 
minutes = now.getMinutes(); 
seconds = now.getSeconds(); 
//timeValue = (hours >= 12) ? " 下午 " : " 上午 "; 
  if (hours>=0){
  timeValue="AM ";}
  if ((hours<12)&&(hours>5)){
  timeValue="AM ";}
  if ((hours>=12)&&(hours<19)){
  timeValue="PM ";}
  if (hours>=19){
  timeValue="PM ";}
  
timeValue += ((hours > 12) ? hours - 12 : hours) + "："; 
timeValue += ((minutes <10)?"0":"") + minutes+"："; 
timeValue += ((seconds <10)?"0":"") + seconds+" "; 
clock.innerHTML = timeValue; 
setTimeout("showtime()",100); 
} 

document.write("</font>");
//-->
       
 

var now,hours,minutes,seconds,timeValue; 

showtime(); 
 
document.write("</font>");
 


