How to get the system time?

  • 617
  • 0

摘要:How to get the system time?

Please refer to the following information:
http://www.dotblogs.com.tw/yc421206/archive/2009/03/11/7441.aspx
http://msdn.microsoft.com/zh-tw/library/ms172517(v=vs.80).aspx

The first method is more simpler then the second.

DateTime dt = DateTime.Now;
MessageBox.Show("==>"+dt.ToString().ToString() );
//This is a simple code to get y,m,d,h,min and s.