First of all you need to create an instance of CultureInfo
that won't be read only. Then you can create an instance of your DateTimeFormatInfo
, configure it appropriately and finally assign it to your CultureInfo
object:
var culture = CultureInfo.CreateSpecificCulture("en-US");
//or simply var culture = new CultureInfo("en-US");
var dateformat = new DateTimeFormatInfo();
//then for example:
dateformat.FullDateTimePattern = "dddd, mmmm dd, yyyy h:mm:ss tt";
culture.DateTimeFormat = dateformat;
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
The full specification on how to configure your DateTimeFormatInfo can be found here.