在日历控制的VALUE属性中填入2010-1-4这样每次打开日历控件时就是这个值,如果想让日历控件值与电脑时间同步,在窗体加载中加入   DTPicker1_Date.Value = Date语句,这样每次启动窗体时,把当前日期写入日历控件中

解决方案 »

  1.   

        function curDateTime(){  
            var d = new Date();   
            var year = d.getFullYear();   
            var month = d.getMonth()+1;   
            var date = d.getDate();   
            var curDateTime= year;  
            if(month>9)  
                curDateTime = curDateTime +"-"+month;  
            else  
                curDateTime = curDateTime +"-0"+month;  
            if(date>9)  
                curDateTime = curDateTime +"-"+date;  
            else  
                curDateTime = curDateTime +"-0"+date;  
            return curDateTime;  
        }绑定你的控件ID 我的为START_TIME
    $('#START_TIME').val(curDateTime());