# Time input (UI SDK): Clock and seconds

> The field shows the locale’s clock. `hourCycle` picks 12 or 24 hours, and `granularity` adds seconds or shows the hour alone. All of them submit 24-hour values.

Canonical: https://hextaui.com/docs/ui-sdk-time-input/examples/clock

Component docs: https://hextaui.com/docs/ui-sdk-time-input

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/ui-sdk-time-input-clock.json
```

This adds `components/examples/ui-sdk-time-input/clock.tsx` with the Time input component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/ui-sdk-time-input/clock.tsx"
import { Label } from "@/components/ui/label"
import { TimeInput } from "@/components/ui/ui-sdk-time-input"

function UiSdkTimeInputClock() {
  return (
    <div className="flex w-full max-w-40 flex-col gap-4">
      <div className="flex flex-col gap-2">
        <Label id="clock-12">12-hour clock</Label>
        <TimeInput
          aria-labelledby="clock-12"
          hourCycle={12}
          defaultValue="18:45"
          locale="en-US"
        />
      </div>
      <div className="flex flex-col gap-2">
        <Label id="clock-24">24-hour clock</Label>
        <TimeInput
          aria-labelledby="clock-24"
          hourCycle={24}
          defaultValue="18:45"
        />
      </div>
      <div className="flex flex-col gap-2">
        <Label id="clock-seconds">With seconds</Label>
        <TimeInput
          aria-labelledby="clock-seconds"
          granularity="second"
          hourCycle={24}
          defaultValue="18:45:30"
        />
      </div>
      <div className="flex flex-col gap-2">
        <Label id="clock-hour">Hour only</Label>
        <TimeInput
          aria-labelledby="clock-hour"
          granularity="hour"
          hourCycle={24}
          defaultValue="18:00"
        />
      </div>
    </div>
  )
}

export { UiSdkTimeInputClock }
```

## Props in this example

### TimeInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `string \| null` | – |  |
| `hourCycle` | `12 \| 24` | – | Defaults to the locale’s clock. |
| `granularity` | `"hour" \| "minute" \| "second"` | `"minute"` |  |
| `locale` | `string` | – | Defaults to the page’s language. |

## More Time input examples

- [Min and max](https://hextaui.com/docs/ui-sdk-time-input/examples/min-max)
- [Invalid](https://hextaui.com/docs/ui-sdk-time-input/examples/range)
- [Locale](https://hextaui.com/docs/ui-sdk-time-input/examples/locale)
- [Form](https://hextaui.com/docs/ui-sdk-time-input/examples/form)
- [Controller](https://hextaui.com/docs/ui-sdk-time-input/examples/controller)
- [Disabled](https://hextaui.com/docs/ui-sdk-time-input/examples/disabled)
- [Read-only](https://hextaui.com/docs/ui-sdk-time-input/examples/read-only)
- [Right to left](https://hextaui.com/docs/ui-sdk-time-input/examples/rtl)
