User-800406098 posted
Hi Leena, thank you for your quick reply.
The solution that you have supplied is a solution. But I would prefer to avoid that for now.
What I'm looking for is for something that might be included on the framework already.
For example, to ensure that the user gets the correct dateTime format string, whether he is using en-US or fr-FR culture, is this:
IFormatProvider myFormatProvider =
Thread.CurrentThread.CurrentCulture;
txtDate.Text = Convert.ToDateTime(txtDate.Text).ToString(myFormatProvider);
If the date is, lets say, January, 3rd of 2010, the returned string will be 1/3/2010 (in en-US) and 3/1/2010 (in fr-FR). The desired value, regardless of which culture is set would be: 01/03/2010 or 03/01/2010. Even cooler would be 01-03-2010
or 03-01-2010 :)
What I'm almost sure of, is that there is a way, to return those formats in a simple fashion . I just don't know which one that is... But I would love too :)
Thanks for your help
Chris.