开发者

Display date in short format (Apr 02)

开发者 https://www.devze.com 2023-03-07 13:03 出处:网络
There is a scenario in which I have to display the date in short format(dd-mmm) for ex : the date selected is 2 April after selecting the above format it开发者_运维百科 should be

There is a scenario in which I have to display the date in short format(dd-mmm)

for ex : the date selected is 2 April after selecting the above format it开发者_运维百科 should be

before      after date format
02 April    Apr 02
15 December Dec 15

How do I accomplish this?


MyDate.ToString("MMM dd");  //Note: Caps on MMM
  • MMM = Abbreviated Month
  • dd = two-digit day

Good References:

  1. Custom Date & Time Formats
  2. Standard Formats (won't help your specific situation)
0

精彩评论

暂无评论...
验证码 换一张
取 消