为什么这句话得不到想要的结果,请测试再下结论,谢谢,马上结贴
<%=string.Format( "yyyy-MM-dd ", "2007-1-10 14:09:41 ")%>
------解决方案--------------------你的这样写法完全错误的.
DateTime dt = Convert.ToDateTime( "2007-1-10 14:09:41 ");
System.Console.Write(dt.ToString( "yyyy-MM-dd "));
------解决方案-------------------- <%=string.Format( "{0:yyyy-MM-dd} ",DateTime.Parse( "2007-1-10 14:09:41 "))%>
<%=DateTime.Parse( "2007-1-10 14:09:41 ").ToString( "yyyy-MM-dd ")%>