- 论坛徽章:
- 0
|
显示日期和时间
[color="#ff0000"]例子1:[color="#ffffff"]现在是: 2005年8月10日 12:11:15 [color="#408080"]= 18) {
document.write("现在是: " + now.toLocaleString())
}
// -->
[color="#000000"]上面这个在低版本浏览器里看不见 [color="#ff0000"]例子2:[color="#ffffff"]今天是 2005 年8 月 10 日 星期三[color="#ffffff"]
[color="#408080"]")
document.write("" + date.fontsize(3) + "");
document.write("")// -->
[color="#ff0000"]例子3:[color="#ffffff"]192005年8月10日 [color="#000000"]星期三 12:11[color="#0000ff"]pm [color="#408080"] " + ((hours >12) ? hours -12 :hours); timeValue += ((minutes :0" : ":") + minutes+"";
timeValue += (hours >= 12) ? "pm" : "am";
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i星期日","星期一","星期二","星期三","星期四","星期五","星期六"); document.write("19",today.getYear(),"年","",today.getMonth()+1,"月","",today.getDate(),"日 ",d[today.getDay()+1]," ",timeValue); //-->
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7702/showart_40376.html |
|