var theform = new date(document.form1.DTFromDate.value);
var theto = new date(document.form1.DTToDate.value);

解决方案 »

  1.   

    给个例子
    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=#ff0000>"+"</font>")
    }
    }}document.write("</table>")
    }
    riq();
      

  2.   


    funcation aa()
    {
    var sj=new Date()
    var tian=sj.getDate()
    var  yue=sj.getMonth()
    document.write("今天是"+yue+tian+"天")
    }
      

  3.   

    不好意思我又遇到一个新问题了就是好象时间不可以加减。
    我意图是:从表单获得两个时间,然后进行相应比较 
    如下:
            var theform = new Date(document.form1.DTFromDate.value);
            var theto = new Date(document.form1.DTToDate.value);
            var frommonth = theform.getMonth() + 1;
            var fromdate = theform.getDate();
            var tomonth = theto.getMonth() + 1;
            var todate = theto.getDate();
            var numb = todate - fromdate;
            var trequesttype = document.forms[0].RequestType.value
            if(trequesttype == "事假"||trequesttype == "病假"){
              if ( numb >7 || tomonth > frommonth )
             {
              .............
              }
              else
              {
               ................
               }
    这个numb好象不是数值了,我怎么比较也没用,郁闷啊!!是怎么回事啊?怎么办呢?
      

  4.   

    明明月份是相等的,可是tomonth 就是不等于frommonth 郁闷郁闷郁闷郁闷!!!!