I have been looking around the web to find an example that will solve my issue with string convertion to datetime.
I would like to convert en-us (mm/dd/yyyy) to dutch belgium (dd/mm/yyyy) datetime. Could you please give me a working example?
For your information, I have tried Convert.ToDateTime, Parse, TryParse, ParseExact etc, but none was working. I really like an example that will make this conversion, no futile links.
Upate
The error I get is: String was not recognized as a valid DateTime. What I have tried:
----------------
string str = "02/20/2012";
DateTime dt = Convert.ToDateTime(str);
---------------------
IFormatProvider theCultureInfo = new System.Globalization.CultureInfo("nl-BE", true);
DateTime theDateTime = DateTime.ParseExact(deliveryDate, "dd/mm/yyyy", theCultureInfo);
Console.WriteLine(dt);
----------------------
var parsed = DateTime.ParseExact("02/20/2012","dd/mm/yyyy", null);
---------------
dateValue = DateTime.Parse(dateString, new CultureInfo("nl-BE", false));
and some other examples which I don't remember them now. But all leading no where.