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で変換したい。日時に変換したい
「08-22T03:32」
日付文字列に年がないため、デフォルトは現在の年になり、次のようになります。
DateTime dt = DateTime.ParseExact(dateString, "MM-ddTHH:mm", CultureInfo.InvariantCulture);
文字列が正しくフォーマットされていれば、DateTime.Parse()が探しているものです。しかし、その文字列の「日付」部分は、機能するには不完全だと思います。