# Selecting the Date Format

## Content



By default, the C1DatePicker control displays the date in a short format, but it can also display the date in a long or custom format. In this topic, you will learn how to change the date format in the designer, in XAML, and in code.

**In the Designer**

To change the date format, complete the following steps:

1.  Click the **C1DatePicker** control once to select it.
2.  In the **Properties** window, click the <span data-popup-content="This class is available in \u003ca href=\u0022/componentone/api/wpf/online-datetimeeditors/dotnet-api/C1.WPF.DateTimeEditors/C1.WPF.DateTimeEditors.C1DatePicker.SelectedDateFormat.html\u0022\u003e.NET\u003c/a\u003e and \u003ca href=\u0022/componentone/api/wpf/online-datetimeeditors/dotnet-api/C1.WPF.DateTimeEditors/C1.WPF.DateTimeEditors.C1DatePicker.SelectedDateFormat.html\u0022\u003e.NET Framework\u003c/a\u003e." data-popup-title="C1DatePicker.SelectedDateFormat" data-popup-theme="ui-tooltip-green qtip-green">C1DatePicker.SelectedDateFormat</span> drop-down arrow and select an option from the list. For this example, select **Long**.

**In XAML**

To change the date format, place **SelectedDateFormat="Long"** within the _<c1:C1DatePicker>_ tags so that the markup resembles the following:

```auto
<c1:C1DatePicker SelectedDateFormat="Long">
```

**In Code**

To change the date format, complete the following steps:

1.  Open the **MainWindow.xaml.cs** page.
2.  Place the following code beneath the **InitializeComponent()** method:
    
    ```vbnet
    C1DatePicker1.SelectedDateFormat = C1.WPF.DateTimeEditors.C1DatePickerFormat.Long
    ```
    
    ```csharp
    c1DateTimePicker1.SelectedDateFormat = C1.WPF.DateTimeEditors.C1DatePickerFormat.Long;
    ```
    
3.  Run the project.

**This Topic Illustrates the Following**:

In this topic, you set the **SelectedDateFormat** to **Long**, which will display the date in a long format. The final result will resemble the following image:

![](https://cdn.mescius.io/document-site-files/images/b827ed78-bea0-4378-af62-5f467cc00dcc/narrative/c1datepicker_long.png)