五月综合缴情婷婷六月,色94色欧美sute亚洲线路二,日韩制服国产精品一区,色噜噜一区二区三区,香港三级午夜理伦三级三

您現在的位置: 365建站網 > 365文章 > javascript輸出時間格式:2009年7月7日

javascript輸出時間格式:2009年7月7日

文章來源:365jz.com     點擊數:767    更新時間:2009-09-17 10:19   參與評論
用C#就這么簡單,看來輸出時間用js不太好。
DateTime.Now.ToShortDateString();//輸出2009-7-7
DateTime.Now.ToString("yyyy年MM月dd日");
DateTime.Now.ToString(
"D");
javascript居然這么大一堆。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    
<title>javascript輸出時間格式:2009年7月7日</title>
    
<script type="text/javascript">    
      
function PageDate(){   
          currentDate 
= new Date()   
          
with(currentDate){   
              day
=getDay()   
              month
=getMonth()+1   
              
this.document.classname="sj"   
              
this.document.write('北京時間   '+getFullYear()+''+month+''+getDate()+'')   
          }   
          
if   (day==1){document.write('   星期一')}   
          
if   (day==2){document.write('   星期二')}   
          
if   (day==3){document.write('   星期三')}   
          
if   (day==4){document.write('   星期四')}   
          
if   (day==5){document.write('   星期五')}   
          
if   (day==6){document.write('   星期六')}   
          
if   (day==0){document.write('   星期日')}   
          
//document.write('<br/>')   
      }   
    
</script>
</head>
<body>
    
<table>
        
<tr>
            
<td>現在時間:</td>
            
<td><script type="text/javascript">PageDate();</script></td>
        
</tr>
    
</table>
</body>
</html>

如對本文有疑問,請?zhí)峤坏浇涣髡搲瑥V大熱心網友會為你解答??! 點擊進入論壇

發(fā)表評論 (767人查看,0條評論)
請自覺遵守互聯(lián)網相關的政策法規(guī),嚴禁發(fā)布色情、暴力、反動的言論。
昵稱:
最新評論
------分隔線----------------------------

其它欄目

· 建站教程
· 365學習

業(yè)務咨詢

· 技術支持
· 服務時間:9:00-18:00
365建站網二維碼

Powered by 365建站網 RSS地圖 HTML地圖

copyright © 2013-2024 版權所有 鄂ICP備17013400號