# TimePicker Formats

You can control the format of the TimePicker by using the [`format`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/timepickercomponent#format) property. The property accepts string parameters and, by default, is set to `'t'`. When the input element is not focused, the TimePicker displays the value in the specified format.

For more information on the supported time formats, refer to the [Formatting Options](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/timepicker/formats#formatting-options) section.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dateinputs/timepicker/formats/source.txt)

## Formatting Options

The [`format`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/timepickercomponent#format) option of the TimePicker supports:

* [Predefined time formats](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/timepicker/formats#predefined-time-formats)
* [Custom time formats](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/timepicker/formats#custom-time-formats)

### Predefined Time Formats

The predefined time formats are specifiers that convert a valid [JavaScript `Date` object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) into a human-readable time based on the locale.

```html
<kendo-timepicker format="T"></kendo-timepicker>
```

The following table lists the supported time format specifiers for the `en` locale. The results are for the time 9:05:03 AM.

| Specifier | Description                     | Result       |
| --------- | ------------------------------- | ------------ |
| `t`       | Short time pattern: `h:mm a`.   | `9:05 AM`    |
| `T`       | Long time pattern: `h:mm:ss a`. | `9:05:03 AM` |

### Custom Time Formats

When the predefined time formats do not fit your requirements, create a custom format string by using one or more custom specifiers.

```html
<kendo-timepicker format="h a"></kendo-timepicker>
<kendo-timepicker format="HH:mm:ss"></kendo-timepicker>
```

The following table lists the supported specifiers for custom time formats. The results are for the time 9:05:03.123 AM.

| Specifier | Description                                                                  | Result                                                                                                                                      |
| --------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `a`       | Renders the day period.                                                      | `a`, `aa`, `aaa`—Short day period name (`AM`).<br />`aaaa`—Wide day period name (`AM`).<br />`aaaaa`—Narrow day period name (`a`).          |
| `h`       | Renders the hour by using a 12-hour clock from 1 to 12.                      | `h a`—Hour (`9 AM`).<br />`hh a`—Zero-padded hour (`09 AM`).                                                                                |
| `H`       | Renders the hour by using a 24-hour clock from 0 to 23.                      | `H:mm`—Hour (`9:05`).<br />`HH:mm`—Two-digit hour (`09:05`).                                                                                |
| `m`       | Renders the minutes from 0 to 59.                                            | `H:m`—Minutes (`9:5`).<br />`H:mm`—Two-digit minutes (`9:05`).                                                                              |
| `s`       | Renders the seconds from 0 to 59.                                            | `HH:mm:s`—Seconds (`09:05:3`).<br />`HH:mm:ss`—Two-digit seconds (`09:05:03`).                                                              |
| `S`       | Renders the fractional seconds. It truncates based on the number of letters. | `s.S`—Fractional seconds (`3.1`).<br />`s.SS`—Two-digit fractional seconds (`3.12`).<br />`s.SSS`—Three-digit fractional seconds (`3.123`). |

#### Read-Only Format Specifiers

The following format specifiers are supported for display purposes only. The TimePicker does not allow users to edit values formatted with these specifiers. The results are for the time 9:05 AM.

| Specifier | Description                                                                                                  | Result                                                                                                                                                                                       |
| --------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `k`       | Renders the hour by using a 24-hour clock from 1 to 24.                                                      | `k:mm`—Hour (`9:05`).<br />`kk:mm`—Two-digit hour (`09:05`).                                                                                                                                 |
| `K`       | Renders the hour by using a 12-hour clock from 0 to 11.                                                      | `K a`—Hour (`9 AM`).<br />`KK a`—Two-digit hour (`09 AM`).                                                                                                                                   |
| `z`       | Renders the time zone.                                                                                       | `z`, `zz`, `zzz`—Short localized GMT format (`GMT+2`).<br />`zzzz`—Long localized GMT format (`GMT+02:00`).                                                                                  |
| `Z`       | Renders the time zone.                                                                                       | `Z`, `ZZ`, `ZZZ`—`ISO8601` format with hours and minutes (`+0200`).<br />`ZZZZ`—Long localized GMT format (`GMT+02:00`).<br />`ZZZZZ`—Extended `ISO8601` format (`+02:00`).                  |
| `x`       | The same as the `X` specifier, except that `x` does not add the UTC indicator when the offset is `0` (zero). | See `X`.                                                                                                                                                                                     |
| `X`       | Renders the time zone.                                                                                       | `X`—`ISO8601` format with hours and optional minutes (`+02`).<br />`XX`, `XXXX`—`ISO8601` format with hours and minutes (`+0200`).<br />`XXX`, `XXXXX`—Extended `ISO8601` format (`+02:00`). |

## Suggested Links

* [API Reference of the TimePicker](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/timepickercomponent)
* [Supported Date and Number Formats](https://github.com/telerik/kendo-intl/tree/master/docs)
