asp.net中datetime转换成字符串怎么处理
1个回答
展开全部
private void Form1_Load(object sender, System.EventArgs e)
{
//textBox1.Text=DateTime.Now.ToString("dd/MM/yyyy");
//textBox1.Text=DateTime.Now.DayOfYear.ToString();
textBox1.Text=DateTime.Now.ToString("d");
textBox2.Text=DateTime.Now.ToString("D");
textBox3.Text=DateTime.Now.ToString("G");
textBox6.Text=DateTime.Now.ToString("g");
textBox5.Text=DateTime.Now.ToString("T");
textBox4.Text=DateTime.Now.ToString("t");
textBox12.Text=DateTime.Now.ToString("F");
textBox11.Text=DateTime.Now.ToString("f");
textBox10.Text=DateTime.Now.ToString("M");
textBox9.Text=DateTime.Now.ToString("R");
textBox8.Text=DateTime.Now.ToString("s");
textBox7.Text=DateTime.Now.ToString("u");
textBox13.Text=DateTime.Now.ToString("Y");
textBox14.Text=DateTime.Now.ToString("y");
}
{
//textBox1.Text=DateTime.Now.ToString("dd/MM/yyyy");
//textBox1.Text=DateTime.Now.DayOfYear.ToString();
textBox1.Text=DateTime.Now.ToString("d");
textBox2.Text=DateTime.Now.ToString("D");
textBox3.Text=DateTime.Now.ToString("G");
textBox6.Text=DateTime.Now.ToString("g");
textBox5.Text=DateTime.Now.ToString("T");
textBox4.Text=DateTime.Now.ToString("t");
textBox12.Text=DateTime.Now.ToString("F");
textBox11.Text=DateTime.Now.ToString("f");
textBox10.Text=DateTime.Now.ToString("M");
textBox9.Text=DateTime.Now.ToString("R");
textBox8.Text=DateTime.Now.ToString("s");
textBox7.Text=DateTime.Now.ToString("u");
textBox13.Text=DateTime.Now.ToString("Y");
textBox14.Text=DateTime.Now.ToString("y");
}
参考资料: http://blog.csdn.net/lqxjlz/archive/2009/09/13/4547781.aspx
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询