Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードを実行すると:
DateTime.ParseExact("03-08-2013", "dd-mm-yyyy", null).ToString("dd-MMM-yyyy")
「2013 年 1 月 3 日」と表示されます
8 月を1月に変換するのはなぜですか?
小文字mmは月ではなく分を意味するため、これは希望どおりに機能するはずです。
mm
DateTime.ParseExact("03-08-2013", "dd-MM-yyyy", null).ToString("dd-MMM-yyyy")
出力:03-Aug-2013
03-Aug-2013