过期作废 发表于 2007-4-27 12:09:39

***时间日期***这个脚本只会显示年份和季节

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果把如下代码加入到<body>区域中

<script language="javascript">

<!-- begin
var now = new date();
var month = now.getmonth() + 1;
var date = now.getdate();
var year = now.getyear();
var season;
if (month > 1 && month <= 3) season = "冬季";
if (month == 3 && date > 19) season = "春季";
if (month > 3 && month <= 6) season = "春季";
if (month == 6 && date > 20) season = "夏季";
if (month > 6 && month <= 9) season = "夏季";
if (month == 9 && date > 21) season = "秋季";
if (month > 9 && month <= 12) season = "秋季";
if (month == 12 && date > 20) season = "冬季";
//y2k fix
if (year < 2000) year = year + 1900;
//winter season fix
if (season == "winter") year = year - 1;
document.write(year + "年 " + season);
//end -->
</script>
      










--------------------------------------

http://www.huoyue.com.cn 活跃网,活跃人群的论坛,访问活跃网,将给您带来意想不到的收获,还可以免费为您开论坛,让您免费拥有与朋友、网友交流的论坛。你是年轻人吗?你活跃你就上!
页: [1]
查看完整版本: ***时间日期***这个脚本只会显示年份和季节