您现在的位置: 新闻中心 > 网站建设技巧
常用的时间日期显示代码

效果如下:




<SCRIPT language=JavaScript>
<!--
function displayWeek() {
 var enabled = 0;
 today = new Date();
 var day;
 if(today.getDay()==0) day = "星期日"
 if(today.getDay()==1) day = "星期一"
 if(today.getDay()==2) day = "星期二"
 if(today.getDay()==3) day = "星期三"
 if(today.getDay()==4) day = "星期四"
 if(today.getDay()==5) day = "星期五"
 if(today.getDay()==6) day = "星期六"
 Todays = new Date(); 
 TheWeek = day
 return (TheWeek);
 }

function displayDate() {
 Todays = new Date();
 //Todays = Todays.setDate(2);
 Mnth = Todays.getMonth()+ 1;
 year = Todays.getFullYear();
 TheDate ="" +year+""+"年" +"" +Mnth +""+"月"+""+Todays.getDate() + "" +"日"+" ";
 theWeeks = displayWeek();
 
 return (TheDate);
 }


function checkword()
{
 document.searchform.searchword1.value=document.searchform.word.value;
 if(document.all.searchform.searchword1.value!="")
 {
  document.all.searchform.searchword.value="docstatus=10 and siteid=2 and  (doctype=10 or doctype=20)  and "+document.all.searchform.searchword1.value;
 }
 else
 {
  document.all.searchform.searchword.value="docstatus=10 and siteid=2 and doctype!=30"
 }
 document.searchform.action="http://search.ce.cn/search/search.jsp";
}


function websearch()
{
 var noteImage = new Image();
  noteImage.src = "http://service.zhongsou.com:8080/cm/noteServlet.gif?partnerID=11952&type=search";
  document.searchform1.word.value=document.searchform.word.value; 
 document.searchform1.action="http://page.zhongsou.com/zspage.cgi?webid=ce";   
}


-->
</SCRIPT>
<TABLE width=195 height=0 border=0 cellPadding=0 cellSpacing=0 class="menuborder">
  <TBODY>
   
    <TR>
      <TD width="195"
            height=20 align=center vAlign=bottom style="PADDING-BOTTOM: 4px"><SCRIPT language=JavaScript>
    <!--
  document.write (displayDate());document.write (displayWeek()); 
   //-->
      </SCRIPT>
          <SCRIPT language=JavaScript>
<!--
function CurentTime(){
var now = new Date();
var hh = now.getHours();
var mm = now.getMinutes();
var ss = now.getTime() % 60000;
ss = (ss - (ss % 1000)) / 1000;
var clock = hh+':';
if (mm < 10) clock += '0';
clock += mm+':';
if (ss < 10) clock += '0';
clock += ss;
return(clock);
}
function refreshCalendarClock(){
document.all.calendarClock4.innerHTML = CurentTime();
}
var webUrl = webUrl;
setInterval('refreshCalendarClock()',1000);
// -->
  </SCRIPT>
     <FONT id=calendarClock4></FONT></TD>
    </TR>
  </TBODY>
</TABLE>

专业网站建设公司,十年建站经验:建站中心 Copyright © 2006-2016 Www.300400.Net 广州市泰葛信息科技有限公司 版权所有  粤ICP备10072568号