# Date and Time Formatting

The DateTimePicker allows you to define its date and time formatting.

The following example demonstrates how to define the date-time format.

```Razor HtmlHelper
    @(Html.Kendo().DateTimePicker()
        .Name("dateTimePicker")
        .Value(DateTime.Now)
        .Format("{0:dd/MM/yyyy hh:mm tt}")
    )
```

```Razor TagHelper
<kendo-datetimepicker name="datetimepicker" 
                      value="DateTime.Now"
                      format="{0:dd/MM/yyyy hh:mm tt}"/>
```

The following example demonstrates how to define the time format.

```Razor HtmlHelper
    @(Html.Kendo().DateTimePicker()
        .Name("dateTimePicker")
        .Value(DateTime.Now)
        .TimeFormat("hh:mm:ss tt") // This format will be used to format the predefined values in the time list.
    )
```

```Razor TagHelper
<kendo-datetimepicker name="datetimepicker" 
                      value="DateTime.Now"
                      time-format="hh:mm:ss tt"/>
```

The following example demonstrates how to define the interval (in minutes) between values in the drop-down list with time slots.

```Razor HtmlHelper
    @(Html.Kendo().DateTimePicker()
        .Name("dateTimePicker")
        .Value(DateTime.Now)
        .Interval(15)
    )
```

```Razor TagHelper
<kendo-datetimepicker name="datetimepicker" 
                      value="DateTime.Now"
                      interval="15"/>
```

## See Also

* [Server-Side API](https://www.telerik.com/aspnet-core-ui/documentation/api/datetimepicker)
