string format = "MMM d, yyyy at h:mm tt";
CultureInfo culture = new CultureInfo("en-US");
DateTime dt = DateTime.ParseExact(dtAsString, format, culture);
Я пытаюсь создать объект DateTime из строк типа [code]Dec 1, 2020 at 11:03 AM Mar 26, 2021 at 7:17 PM Oct 21, 2020 at 3:07 PM [/code] Я использую это, но выдает ошибку: [code]string format = "MMM d, yyyy at h:mm tt"; CultureInfo culture = new CultureInfo("en-US"); DateTime dt = DateTime.ParseExact(dtAsString, format, culture); [/code] Что я делаю не так?