再次发贴求解传过来的日期单位数前没零的解决办法,高手来帮帮!
function getvalue(obj,inputObj) //把选择的日期传给输入框
{
var myObj=inputObj.nextSibling.nextSibling.childNodes[0].childNodes[0].cells[2].childNodes;
if(obj.innerHTML)
inputObj.value=myObj[0].innerHTML+ "- "+myObj[2].innerHTML+ "- "+obj.innerHTML;
inputObj.nextSibling.nextSibling.style.display= 'block ';
for(i=0;i <obj.parentNode.parentNode.parentNode.cells.length;i++)
obj.parentNode.parentNode.parentNode.cells[i].className= ' ';
obj.className= 'ds_border2 ';
location.href= 'show_search.aspx?search_time= '+inputObj.value+ ' ';
}
show_search.aspx:
public DateTime uid;
uid =Convert.ToDateTime(Request.QueryString[ "search_time "]);
SqlCommand cmd = new SqlCommand( "select * from content where Convert(char(10),PubTime,120)= '% " + uid+ "% ' ", conn);
传过来的值比如说是2007-9-1
但是数据库里是2007-09-01
少个零,现在传过来的值是固定的了,怎么解决呢,大哥们帮帮!!
------解决方案--------------------少个什么0???
------解决方案-------------------- 传过来的值比如说是2007-9-1
但是数据库里是2007-09-01
少个零,现在传过来的值是固定的了,怎么解决呢,大哥们帮帮!!
///
string time=Conver.toDateTime( "2007-9-1 ").ToString( "yyyy-MM-dd ");
------解决方案--------------------传标准GMT时间戳......