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.
@(Html.Kendo().DateTimePicker()
.Name("dateTimePicker")
.Value(DateTime.Now)
.Format("{0:dd/MM/yyyy hh:mm tt}")
)
<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.
@(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.
)
<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.
@(Html.Kendo().DateTimePicker()
.Name("dateTimePicker")
.Value(DateTime.Now)
.Interval(15)
)
<kendo-datetimepicker name="datetimepicker"
value="DateTime.Now"
interval="15"/>