Version

Setting the Culture of WebDateTimeEditor

WebDateTimeEditor™ allows you set a specific culture on how to display the date/time by setting the control’s Culture property. WebDateTimeEditor relies on the CultureInfo class in order to format its data. By default it will use the current culture that is set on your system.

You can set the Culture property either by using the Microsoft® Visual Studio® Property Window or by using the following code:

In Visual Basic:

'Specify the culture or locale you want to use
 Dim c As New System.Globalization.CultureInfo("en-GB")
'Assign the CultureInfo object to the WebDateTimeEditor's culture
WebDateTimeEditor1.Culture = c

In C#:

//Specify the culture or locale you want to use
System.Globalization.CultureInfo c = new System.Globalization.CultureInfo("en-GB");
//Assign the CultureInfo object to the WebDateTimeEditor's Culture
WebDateTimeEditor1.Culture = c;
WebDateTimeEditor Setting the culture of WebDateTimeEditor 01.png