# How to set different culture

In many scenarios it is useful to set a specific Culture in your application that differs from the Culture of the environment. In those cases the easiest and straight forward approach is to set the **CurrentCulture** and **CurrentUICulture** to the desired custom **CultureInfo**.

The **RadDateTimePicker** control uses that Culture in order to parse the input date and time that is added in the TextBox of the control.

## Setting different CurrentCulture and CurrentUICulture

The next code snippet demonstrates how to set the CurrentCulture and CurrentUICulture to US culture:

```C#
InitializeComponent();

var culture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
```

The next figures show the difference with the custom en-US culture and the normal environment culture (which in this case is bg-BG):

> caption With the custom en-US set

![raddatetimepicker-how-to-set-culture-1](https://www.telerik.com/products/wpf/documentation/assets/9ed9f9afc9399c0e73305d0a089ce961/raddatetimepicker-how-to-set-culture-1.png)

> caption With the normal environment culture

![raddatetimepicker-how-to-set-culture-2](https://www.telerik.com/products/wpf/documentation/assets/33adbe9b2d9fe2b01fdfabf8963081e8/raddatetimepicker-how-to-set-culture-2.png)

## Setting Custom DateTimeFormat

If you want to customize the patter of the ShortDatePattern and ShortTimePattern all you need to do is:

* Create a CultureInfo object and set it to the desired culture

* Create a DateTimeFormatInfo object and set its ShortDatePattern, ShortTimePattern

* Set newly created CultureInfo to the CurrentCulture and CurrentUICulture

The next code snippet shows how to set the date pattern in order to change the date separator from “/” to “-”:

> In order for the parsing of the input date to be correct you need to make sure that the **DateSeparator** is set to the desired symbol in the ShortDatePattern.

```C#
InitializeComponent();

var culture = new CultureInfo("en-US");
var dtfInfo = new DateTimeFormatInfo
{
    ShortDatePattern = "MM-dd-yyyy",
    ShortTimePattern = "HH:mm",
    DateSeparator = "-"
};
culture.DateTimeFormat = dtfInfo;
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
```

The next figure shows the final result:

> caption Setting US culture with custom ShortDate/TimePattern

![raddatetimepicker-how-to-set-culture-3](https://www.telerik.com/products/wpf/documentation/assets/816370a1639ab5f006a8f28644db28dc/raddatetimepicker-how-to-set-culture-3.png)
