---
title: "Clock"
description: "The current time in any time zone, as text that keeps itself up to date. A hover shows the full date and the zone."
url: https://gelatinui.com/components/clock
markdown_url: https://gelatinui.com/components/clock.md
access: free
install: "npx shadcn@latest add @gelatin-ui/clock"
registry_item: https://gelatinui.com/r/clock.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Clock

> The current time in any time zone, as text that keeps itself up to date. A hover shows the full date and the zone.

Page: https://gelatinui.com/components/clock

## When to use it

Best for: The live time in one zone as text, in the size and color of the text around it.

- Use it for the time now in a zone, such as a city on a team page.
- Use `timeZoneName` for a muted zone label, such as GMT+2.
- Use `showSeconds` when the seconds matter. The default wakes once a minute.
- Use `dateStyle` or `showDayWord` when the zone can be on another day.

## When not to use it

- For a clock face, use an [Analog Clock](https://gelatinui.com/components/analog-clock.md).
- For one moment in the zone of the reader and in another zone, use [Local Time](https://gelatinui.com/components/local-time.md).
- For a fixed date or time, use [Date Display](https://gelatinui.com/components/date-display.md).

## Notes for agents

- Set `timeZone` to an IANA id. With no zone, it uses the zone of the browser.
- It has no size of its own. It takes the font size and color of the parent.
- All clocks share one timer, and no timer runs while the tab is hidden.
- Set `tooltip={false}` in a row that already shows the zone.
- Pass `now` for a fixed time in tests and screenshots.

## Anatomy

```text
Clock
```

## API reference

### Clock

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `timeZone` | `string` |  | The IANA zone ("Asia/Tokyo"). Default: the runtime zone. Summer time comes from the zone. |
| `hourCycle` | `HourCycle` |  | `12` ("2:32 PM") or `24` ("14:32"), as the other time components take it. Default: the locale's cycle. |
| `showSeconds` | `boolean` | false | Show the seconds. `false` (default) wakes on each minute; `true` wakes each second. |
| `timeZoneName` | `"long" \| "longGeneric" \| "longOffset" \| "short" \| "shortGeneric" \| "shortOffset"` |  | A zone label after the time, in muted text (`data-slot="clock-zone"`): `short` ("CEST" in en-GB, "GMT+2" in en-US), `shortOffset` ("GMT+2"), `long` ("Central European Summer Time"). Default: no label. |
| `dateStyle` | `"short-weekday" \| NonNullable` |  | A date part before the time, in muted text (`data-slot="clock-date"`): `short-weekday` ("Wed, Nov 4 14:32"), or an `Intl` style (`short`, `medium`, `long`, `full`). The date is the day in `timeZone`. Default: no date part. |
| `showDayWord` | `boolean` | false | When `timeZone` is on another day than the reader: "tomorrow" or "yesterday" after the time, in muted text (`data-slot="clock-day"`), from `Intl.RelativeTimeFormat`. It shows after hydration only (the server does not know the reader's zone), and not with `dateStyle`. Default `false`: a world clock row often puts the day in a lane of its own. |
| `locale` | `string` |  | The BCP 47 language tag. Default: the `DisplayLocaleProvider` locale, else "en-US". |
| `now` | `number \| Date` |  | A fixed now for tests and stories. With it, no timer runs. |
| `tooltip` | `boolean` | true | Show the full date and the long zone name in a Tooltip on hover. Default `true`. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Clock | `clock` |  |  |  |

## Usage

Import Clock and compose its parts.

```tsx title="clock.tsx"
import { Clock } from "@/components/ui/clock";

export function ClockDemo() {
  return (
    <Clock
      timeZone="America/New_York"
      locale="en-US"
      timeZoneName="short"
      className="text-sm"
    />
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/clock
```

It adds 33 registry items: 30 files, 4244 lines, and the npm packages `@base-ui/react`, `@internationalized/date`, `clsx`, `react-aria-components`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Full Value](https://gelatinui.com/components/full-value.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Analog Clock](https://gelatinui.com/components/analog-clock.md)
- [Local Time](https://gelatinui.com/components/local-time.md)
- [Date Display](https://gelatinui.com/components/date-display.md)
