DateTime.TosString()
时间示例:2014-6-4

问题:一般我们需要展现不同时间格式会用到date.ToString("yyyy-MM-dd") 方法,但是 6/4/2014 这样的却不能通过 date.ToString("M/d/yyyy")达到目的。下面根据MSDN整理了几种格式,详细参阅MSDN资料


date.ToString("d", System.Globalization.CultureInfo.CreateSpecificCulture("en-US"))    6/4/2014
date.ToString("d", System.Globalization.CultureInfo.CreateSpecificCulture("es-ES"))    04/06/2014
date.ToString("d", System.Globalization.CultureInfo.CreateSpecificCulture("de-DE"))    04.06.2014

更多详情请参考MSDN官方资料:http://msdn.microsoft.com/zh-cn/library/8tfzyc64.aspx

相关文章:

  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-08-26
  • 2022-12-23
  • 2021-07-21
猜你喜欢
  • 2022-02-20
  • 2021-07-03
  • 2022-12-23
  • 2022-01-20
相关资源
相似解决方案