`
javatoyou
  • 浏览: 1018818 次
  • 性别: Icon_minigender_2
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

DateTime类型ToString时要显示AM/PM怎么办

 
阅读更多


Explanation:tgives the first character of the AM/PM designator (the localized designator can be retrieved inDateTimeFormatInfo.AMDesignatorandDateTimeFormatInfo.PMDesignator). The\\Mescapes theMso thatDateTime.ToStringdoes not interpret it as part of the format string and print the numerical value of the month.

Note that once you do this you are explicitly being culture insensitive. For example, in Japan, the AM/PM designator differs in the second characters, not the first.


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics