I have the following code that produces a date string in en-us format. I would like to pass in the LCID (or equivalent value for the localized language) to produce the localized version of the date string. How would I accomplish this?
public static string ConvertDateTimeToDate(string dateTimeString) {
CultureInfo culture = CultureInfo.InvariantCulture;
DateTime dt = DateTime.MinValue;
if (DateTime.TryParse(dateTimeString, out dt))
{
return dt.ToShortDateString();
}
return dateTimeString;
}