JavaScript显示当前日期代码

时间:2010-04-13 12:21:08  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:="April";months[5]="May";months[6]="June";months[7]="July";months[8]="August";months[9]="September";months[10]="October";months[11]="November";months[12]="December";var time=new Date();var lmonth=months[time.ge...
  正文:JavaScript显示当前日期源码

<SCRIPT LANGUAGE="JavaScript1.2">
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000)   
year = year + 1900;
document.write("<center>" + lmonth + " ");
document.write(date + ", " + year + "</center>");
</SCRIPT>

"JavaScript显示当前日期代码"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Programming/JavaScript/13616.html


关键字:

关于《JavaScript显示当前日期代码》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td