有关DateTime的几个格式.

  1. Console.WriteLine("DateTime.Today:\t"+DateTime.Today.ToString()); 
  2. Console.WriteLine("DateTime.Now:\t"+DateTime.Now.ToString()); 
  3. Console.WriteLine("DateTime.UtcNow:\t" + DateTime.UtcNow.ToString()); 
  4. Console.WriteLine("new DateTime():\t"+new DateTime().ToString()); 
  5. Console.WriteLine("new DateTime().ToLocalTime():\t" + new DateTime().ToLocalTime().ToString()); 
  6. Console.WriteLine("new DateTime().ToShortDateString():\t"+new DateTime().ToShortDateString()); 
  7. Console.WriteLine("new DateTime().ToShortTimeString():\t"+new DateTime().ToShortTimeString()); 
  8. Console.WriteLine("new DateTime().ToLongDateString():\t" + new DateTime().ToLongDateString()); 
  9. Console.WriteLine("new DateTime().ToLongTimeString():\t"+new DateTime().ToLongTimeString()); 
  10. Console.WriteLine("new DateTime().ToUniversalTime():\t" + new DateTime().ToUniversalTime().ToString()); 

有关DateTime的几个格式.

创新互联,专注为中小企业提供官网建设、营销型网站制作、成都响应式网站建设、展示型成都网站建设、成都网站设计等服务,帮助中小企业通过网站体现价值、有效益。帮助企业快速建站、解决网站建设与网站营销推广问题。


本文名称:有关DateTime的几个格式.
文章转载:http://ybzwz.com/article/gdpehp.html