ASP.NET(C#) 开发WebForm小弟使用如下代码的时候
Label1.Text = DateTime.Now.ToShortDate();如果日期为2005年7月1日,那么这样将取得2005-7-1的日期格式,现在想要2005-07-01的日期格式,代码要如何写啊???最好是简单一点的方法!!请大侠指点一下,谢谢!
学习,关注……
Label1.Text = DateTime.Now.ToShortDate();如果日期为2005年7月1日,那么这样将取得2005-7-1的日期格式,现在想要2005-07-01的日期格式,代码要如何写啊???最好是简单一点的方法!!请大侠指点一下,谢谢!
学习,关注……
Label1.Text = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString("00") + "-" + DateTime.Now.Day.ToString("00");
在数据表时间字段的数据是:2005-5-5
select Varchar(varchar(30),birthday,111) as birthday from customer
这样就可以啦.