I am needing to parse Oct 3, 2014 10:05 a.m.
I'm familiar with using the DateTime.TryParseExact()
using the TT
expression for the AM or PM. However modifying it to T.T.
does not successfully parse the string
into a DateTime
.
Here's the code I have:
string dateContent = "Oct 3, 2014 10:05 a.m.";
DateTime parseDate;
bool attempt = DateTime.TryParseExact(content, "MMM d, yyyy hh:mm T.T.", CultureInfo.CurrentCulture, DateTimeStyles.None, out parseDate);
Any help would be greatly appreciated. Let me know if anything is missing, or needs clarification.