ComponentOne DateTimeEditors for UWP
C1DateTime Picker Help / C1DateTimePicker Task-Based Help / Selecting the Date Format
In This Topic
    Selecting the Date Format
    In This Topic

    By default, the C1DateTimePicker control's date picker displays the date in a short format, but it can also display time in a long 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 C1DateTimePicker control once to select it.
    2. In the Properties window, click the C1DateTimePicker.DateFormat drop-down arrow and select a mode from the list. For this example, select Long.

    In XAML

    To change the date format, place DateFormat="Long" to the <DateTimeEditors:C1DateTimePicker>tag so that the markup resembles the following:

    Markup
    Copy Code
    <DateTimeEditors:C1DateTimePicker DateFormat="Long">
    

    In Code

    To change the date format, complete the following steps:

    1. Open the MainPage.xaml.cs page.
    2. Place the following code beneath the C1DateTimePicker_Loaded event:
    Visual Basic
    Copy Code
    C1DateTimePicker1.DateFormat = Microsoft.Windows.Controls.DatePickerFormat.Long
    
    C#
    Copy Code
    c1DateTimePicker1.DateFormat = Microsoft.Windows.Controls.DatePickerFormat.Long;
    
    1. Run the project.

    This Topic Illustrates the Following:

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

     

    See Also