# Selected Times

The TimePicker allows you to render a pre-selected time and also define the minimum and maximum time it displays.

For a complete example on how to select ranges using TimePicker, refer to the [demo on range selection](https://demos.telerik.com/aspnet-core/timepicker/rangeselection).

The following example demonstrates how to render a TimePicker with an initially selected time and defined min and max times. The TimePicker sets the value only if the entered time is within the defined range and is valid.

```Razor HtmlHelper
    @(Html.Kendo().TimePicker()
        .Name("timepicker")
        .Value("8:00 AM")
        .Min("8:00 AM")
        .Max("5:00 PM")
    )
```

```Razor TagHelper
<kendo-timepicker name="timePicker"
                  value="new DateTime(1900, 1, 1, 8, 00, 0)"
                  min="new DateTime(1900, 1, 1, 8, 00, 0)"
                  max="new DateTime(1900, 1, 1, 17, 00, 0)" />
```

## See Also

* [Selecting Time Ranges with the TimePicker HtmlHelper for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/timepicker/rangeselection)
* [Server-Side API](https://www.telerik.com/aspnet-core-ui/documentation/api/timepicker)
