我似乎無法找到如何將字符串轉換爲日期時間。這是我的約會的樣子:「23-nov-12」。將字符串轉換爲日期時間失敗
我試過如下:
DateTime convertedDate = DateTime.ParseExact("dd-MMM-yy", "23-nov-12", CultureInfo.InvariantCulture);
也
DateTime convertedDate = DateTime.ParseExact("0:d-MMM-yy", "23-nov-12", CultureInfo.InvariantCulture);
但我一直得到以下錯誤:
String was not recognized as a valid DateTime.
有成千上萬的線程在討論相同的問題! 做更多的研究! – AAlferez