110,533
社区成员
发帖
与我相关
我的任务
分享
DateTime m_date = Convert.ToDateTime("1998-02-01");
Console.WriteLine(m_date.ToString());
DateTime m_date1 = m_date.AddYears(DateTime.Now.Year - m_date.Year);
Console.WriteLine(m_date1.ToString());
Console.Read();
DateTime date = DateTime.Parse("2010年4月26日 23:18:23");
MessageBox.Show(string.Format("{0:yyyy MM dd HH mm ss}", date));
MessageBox.Show(date.ToString("yyyy MM dd HH mm ss",DateTimeFormatInfo.InvariantInfo));
//楼主的意思是这个吗? 假设1999是你已知的年份
DateTime dt = new DateTime(1999);