datetime问题!!!!
怎么样把时间设置为:"yyyy-MM-dd HH:mm"的格式,去掉秒,比如2005-09-27 13:08在登陆的时候把登陆时间记录到数据库里,在成功登陆后就可以把数据都显示出来,包括登陆的时间字段
if(System.DateTime.Now.Month<10&&System.DateTime.Now.Day<10)
{
this.textBox1.Text+=System.DateTime.Now.Hour+":"+System.DateTime.Now.Minute+" "+
System.DateTime.Now.Year+"-"+"0"+
System.DateTime.Now.Month+"-"+"0"+System.DateTime.Now.Day;
}
else
this.textBox1.Text+=System.DateTime.Now.Hour+":"+System.DateTime.Now.Minute+" :"+System.DateTime.Now.Second+" "+
System.DateTime.Now.Year+"-"+
System.DateTime.Now.Month+"-"+System.DateTime.Now.Day;
}