日期时间源代码

日期时间源代码

 日期显示形式源代码目录:1  1.1  1.2  1.3  2  3.1  5 6.1                 
日期显示形式 1

(能设置颜色)

查看源代码:

<font color=0000FF><script><!--
todayDate = new Date();
date = todayDate.getDate();
month= todayDate.getMonth() +1;
year= todayDate.getYear();
document.write("今天是")
document.write("<br>")
if(navigator.appName == "Netscape")
{
document.write(1900+year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");
document.write("<br>")
}
if(navigator.appVersion.indexOf("MSIE") != -1)
{
document.write(year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");
document.write("<br>")
}
if (todayDate.getDay() == 5) document.write("星期五")
if (todayDate.getDay() == 6) document.write("星期六")
if (todayDate.getDay() == 0) document.write("星期日")
if (todayDate.getDay() == 1) document.write("星期一")
if (todayDate.getDay() == 2) document.write("星期二")
if (todayDate.getDay() == 3) document.write("星期三")
if (todayDate.getDay() == 4) document.write("星期四")

//--> </script></font>                                 返回目录

日期显示形式 2

(能设置颜色)

源代码:

<font color=FF0000><script>n=new Date();r=n.getYear();if (r<2000) r="19"+r;m=n.getMonth()+1;d=n.getDate();q=n.getDay();if(m<10) m="0"+m;if(d<10) d="0"+d;if(q==0){var t="日";}if(q==1){var t="一";}if(q==2){var t="二";}if(q==3){var t="三";}if(q==4){var t="四";}if(q==5){var t="五";}if(q==6){var t="六";}document.write(r+"年"+m+"月"+d+"日 "+"星期"+t);</script></font>

                                               返回目录

日期显示形式 3

(默认颜色)

 

源代码:

<b><script>n=new Date();r=n.getYear();if (r<2000) r="19"+r;m=n.getMonth()+1;d=n.getDate();q=n.getDay();if(m<10) m="0"+m;if(d<10) d="0"+d;if(q==0){var t="日";}if(q==1){var t="一";}if(q==2){var t="二";}if(q==3){var t="三";}if(q==4){var t="四";}if(q==5){var t="五";}if(q==6){var t="六";}document.write(r+"年"+m+"月"+d+"日 "+"星期"+t);</script></b>                             返回目录

日期显示形式 1.1

(能设置颜色)

 

<font color=0000FF><script><!--
todayDate = new Date();
date = todayDate.getDate();
month= todayDate.getMonth() +1;
year= todayDate.getYear();
document.write("<br>")
if(navigator.appName == "Netscape")
{
document.write(1900+year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");
document.write("<br>")
}
if(navigator.appVersion.indexOf("MSIE") != -1)
{
document.write(year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");
document.write("<br>")
}
if (todayDate.getDay() == 5) document.write("星期五")
if (todayDate.getDay() == 6) document.write("星期六")
if (todayDate.getDay() == 0) document.write("星期日")
if (todayDate.getDay() == 1) document.write("星期一")
if (todayDate.getDay() == 2) document.write("星期二")
if (todayDate.getDay() == 3) document.write("星期三")
if (todayDate.getDay() == 4) document.write("星期四")

//--> </script></font>                       
返回目录
日期显示形式 1.2

(能设置颜色)

查看源代码:

<font color=0000FF><script><!--
todayDate = new Date();
date = todayDate.getDate();
month= todayDate.getMonth() +1;
year= todayDate.getYear();
document.write("今天是")

if(navigator.appName == "Netscape")
{
document.write(1900+year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");

}
if(navigator.appVersion.indexOf("MSIE") != -1)
{
document.write(year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");

}
if (todayDate.getDay() == 5) document.write("星期五")
if (todayDate.getDay() == 6) document.write("星期六")
if (todayDate.getDay() == 0) document.write("星期日")
if (todayDate.getDay() == 1) document.write("星期一")
if (todayDate.getDay() == 2) document.write("星期二")
if (todayDate.getDay() == 3) document.write("星期三")
if (todayDate.getDay() == 4) document.write("星期四")

//--> </script></font>                              返回目录

日期显示形式 1.3
(能设置颜色)

源代码:

<font color=0000FF><script><!--
todayDate = new Date();
date = todayDate.getDate();
month= todayDate.getMonth() +1;
year= todayDate.getYear();
if(navigator.appName == "Netscape")
{
document.write(1900+year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");

}
if(navigator.appVersion.indexOf("MSIE") != -1)
{
document.write(year);
document.write("年");

document.write(month);
document.write("月");
document.write(date);
document.write("日");

}
if (todayDate.getDay() == 5) document.write("星期五")
if (todayDate.getDay() == 6) document.write("星期六")
if (todayDate.getDay() == 0) document.write("星期日")
if (todayDate.getDay() == 1) document.write("星期一")
if (todayDate.getDay() == 2) document.write("星期二")
if (todayDate.getDay() == 3) document.write("星期三")
if (todayDate.getDay() == 4) document.write("星期四")

//--> </script></font>

                                               返回目录

日期显示形式 3.1
(能设置颜色)
源代码

<b><font color=FF0000><script>n=new Date();r=n.getYear();if (r<2000) r="19"+r;m=n.getMonth()+1;d=n.getDate();q=n.getDay();if(m<10) m="0"+m;if(d<10) d="0"+d;if(q==0){var t="日";}if(q==1){var t="一";}if(q==2){var t="二";}if(q==3){var t="三";}if(q==4){var t="四";}if(q==5){var t="五";}if(q==6){var t="六";}document.write(r+"年"+m+"月"+d+"日 "+"星期"+t);</script></font></b>
                                                
返回目录

日期显示形式 4
源代码

<script>n=new Date();r=n.getYear();if (r<2000) r="19"+r;m=n.getMonth()+1;d=n.getDate();if(m<10) m="0"+m;if(d<10) d="0"+d;document.write(r+"年"+m+"月"+d+"日");</script>

日期显示形式 5
源代码

<script>n=new Date();r=n.getYear();if (r<2000) r="19"+r;m=n.getMonth()+1;d=n.getDate();q=n.getDay();if(m<10) m="0"+m;if(d<10) d="0"+d;if(q==0){var t="日";}if(q==1){var t="一";}if(q==2){var t="二";}if(q==3){var t="三";}if(q==4){var t="四";}if(q==5){var t="五";}if(q==6){var t="六";}document.write(r+"年"+m+"月"+d+"日 "+"星期"+t);</script>   返回目录

日期显示形式 6
(能设置颜色)
源代码
<b><font color=0000FF><SCRIPT language=JavaScript>

<!-- 
var noon; 
var time=new Date(); 
var hour=time.getHours(); 
var minute=time.getMinutes(); 
var today=new Date;
var week=new Array(7); 
week[0]="天"; 
week[1]="一"; 
week[2]="二"; 
week[3]="三"; 
week[4]="四"; 
week[5]="五"; 
week[6]="六"; 
if (hour<5) noon="凌晨";
if (hour>4 & hour<8) noon="早晨";
if (hour>7 & hour<12) noon="上午";
if (hour==12) noon="中午";
if (hour>12 & hour<19) noon="下午";
if (hour>18 & hour<23) noon="晚上";
if (hour>22) noon="深夜";
if (hour>12) hour=hour-12;
if (hour<10) hour="0"+hour;
if (minute<10) minute="0"+minute;
document.write("<span class='p9'>");
document.write(today.getYear()+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日 星期"+week[today.getDay()]+" "+"北京时间:"+noon+" "+hour+":"+minute+" "); 
document.write("</span>");

//--> 
</SCRIPT></font></b>                           
返回目录
日期显示形式 6.1
源代码
<font color=0000FF><SCRIPT language=JavaScript>

<!-- 
var noon; 
var time=new Date(); 
var hour=time.getHours(); 
var minute=time.getMinutes(); 
var today=new Date;
var week=new Array(7); 
week[0]="天"; 
week[1]="一"; 
week[2]="二"; 
week[3]="三"; 
week[4]="四"; 
week[5]="五"; 
week[6]="六"; 
if (hour<5) noon="凌晨";
if (hour>4 & hour<8) noon="早晨";
if (hour>7 & hour<12) noon="上午";
if (hour==12) noon="中午";
if (hour>12 & hour<19) noon="下午";
if (hour>18 & hour<23) noon="晚上";
if (hour>22) noon="深夜";
if (hour>12) hour=hour-12;
if (hour<10) hour="0"+hour;
if (minute<10) minute="0"+minute;
document.write("<span class='p9'>");
document.write(today.getYear()+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日 星期"+week[today.getDay()]+" "+"北京时间:"+noon+" "+hour+":"+minute+" "); 
document.write("</span>");

//--> 
</SCRIPT></font>                                  
返回目录
新建网页 1


©2009-2016《感悟人生》保留所有权利  本站由 雨晴 制作维护    
   lyfeng46@163.com
备案许可证号:京ICP备12020752号-1