alert("现在是 "+ (new Date().getMonth() + 1) +" 月!");

解决方案 »

  1.   

    myarray=date()
    riqi=split(myarray,"-")
    response.write riqi(1)
      

  2.   

    如果只要天的话 这样就可以了
    <sctipt>
    var sj=new Date()
    var tian=sj.getDate()
    alert("今天是"+tian+"好")
    </script>要更具体一点的话则
    <script>
    function riq(){
    var sj=new Date()
    var tian=sj.getDate()
    var  xinqi=sj.getDay()
    var  yue=sj.getMonth()
    document.write("<table   cellspacing=1 cellpadding=1><tr>")
    for(i=1;i<=30;i++){
    if(tian==i){
    document.write("<td><font color=#ff0000>"+i+"<font></td>")
    }else{
    document.write("<td    width=30><font color=#600366>"+i+"<font></td>")}
    if(i%7==0){
    document.write("</br><tr>")
       
    if(tian==i){
    document.write("<font color='#996699'>2004年"+yue+"<font color=#ff0000>"+"</font>"+"<font size=2 color='red'>"+"星期"+xinqi+"</font">)
    }
    }}document.write("</table>")
    }
    riq();
    </script>
      

  3.   

    上面的有误
    如果只要天的话 这样就可以了<sctipt>
    var sj=new Date()
    var  yue=sj.getMonth()
    alert("今天是"+yue+"好")
    </script>
    要更具体一点的话则
    <script>
    function riq(){
    var sj=new Date()
    var tian=sj.getDate()
    var  xinqi=sj.getDay()
    var  yue=sj.getMonth()
    document.write("<table   cellspacing=1 cellpadding=1><tr>")
    for(i=1;i<=30;i++){
    if(tian==i){
    document.write("<td><font color=#ff0000>"+i+"<font></td>")
    }else{
    document.write("<td    width=30><font color=#600366>"+i+"<font></td>")}
    if(i%7==0){
    document.write("</br><tr>")
       
    if(tian==i){
    // i++
    document.write("<font color='#996699'>2004年"+yue+"月"+"</font>"+"<font color=#ff0000>"+"</font>"+"<font size=2 color='red'>"+"天"+"星期"+xinqi+"</font">)
    }
    }}document.write("</table>")
    }
    riq();
    </script>