G
Guest
Hi
Why does this alway return false ????
I would think I have all the correct formats
Is there a built in format ie f,F,g,G for datetime with AM/PM ???
Thanks
string[] dateFormats = { "f", "F", "g", "G",
"dd-MM-yyyy hh:mm tt",
"MM-dd-yyyy hh:mm tt",
"dd/MM/yyyy hh:mm tt",
"MM/dd/yyyy hh:mm tt",
"dd.MM.yyyy hh:mm tt",
"MM.dd.yyyy hh:mm tt"
};
bool bResult = DateTime.TryParseExact("10/18/2007 12:00 AM",
dateFormats, null, DateTimeStyles.None,
out date);
I have CultureInfo = "es-ES"
Why does this alway return false ????
I would think I have all the correct formats
Is there a built in format ie f,F,g,G for datetime with AM/PM ???
Thanks
string[] dateFormats = { "f", "F", "g", "G",
"dd-MM-yyyy hh:mm tt",
"MM-dd-yyyy hh:mm tt",
"dd/MM/yyyy hh:mm tt",
"MM/dd/yyyy hh:mm tt",
"dd.MM.yyyy hh:mm tt",
"MM.dd.yyyy hh:mm tt"
};
bool bResult = DateTime.TryParseExact("10/18/2007 12:00 AM",
dateFormats, null, DateTimeStyles.None,
out date);
I have CultureInfo = "es-ES"