北京时间:

<SCRIPT language=JavaScript>

today=new Date();

var hours = today.getHours();

var hours1 = (hours <= 12) ? hours : hours-12;

var minutes = today.getMinutes();

var AMPM = ((hours <= 12) ? "上午":"下午");

AMPM += hours1

AMPM += ((minutes < 10) ? "<BLINK>:</BLINK>0":"<BLINK>:</BLINK>") + minutes;

 

function initArray(){

this.length=initArray.arguments.length

for(var i=0;i<this.length;i++)

this[i+1]=initArray.arguments[i]}

var d=new initArray("日","一","二","三","四","五","六");

 

document.write(

today.getYear(),"年",

today.getMonth()+1,"月",

today.getDate(),"日 星期",

d[today.getDay()+1]," ",

AMPM);

</SCRIPT>