---
title: "Local Time"
description: "One moment in two zones: your time first, then the time of the event or the person, with a day word when the day is not the same."
url: https://gelatinui.com/components/local-time
markdown_url: https://gelatinui.com/components/local-time.md
access: free
install: "npx shadcn@latest add @gelatin-ui/local-time"
registry_item: https://gelatinui.com/r/local-time.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Local Time

> One moment in two zones: your time first, then the time of the event or the person, with a day word when the day is not the same.

Page: https://gelatinui.com/components/local-time

## When to use it

Best for: One moment in the zone of the reader and in one other zone, inline or stacked.

- Use it for an invite or an event that happens in another zone.
- Use `date="now"` for the time now of a person, with how far ahead or behind they are.
- Use `layout="stacked"` in a card, and `inline` in a line of text.

## When not to use it

- For the time in one zone only, use a [Clock](https://gelatinui.com/components/clock.md).
- For a date or a range with no second zone, use [Date Display](https://gelatinui.com/components/date-display.md).
- To pick a zone, use a [Time Zone Select](https://gelatinui.com/components/time-zone-select.md).

## Notes for agents

- `timeZone` is the zone of the event or the person. The reader's zone comes from the browser, or from `localTimeZone`.
- Before hydration the server shows their time only. The reader's time fades in after.
- Pass `localTimeZone` when the server knows the zone, so the text renders at once.
- When both zones are the same, it shows one time with its zone.
- Pass `end` for a range.

## Anatomy

```text
LocalTime
└─ LocalTimeEmpty (0..n)
```

## API reference

### LocalTime

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `layout` | `"inline" \| "stacked"` | "inline" |  |
| `date` | `DateLike \| null` |  | The moment (an invite, a booking, office hours): a `Date`, an ISO string, epoch milliseconds, or a `DateValue`; a value with no zone ("2026-11-12T09:00") is a wall time in `timeZone`. The text `"now"`: their time now, kept true (a team card). `null` shows "—". |
| `end` | `DateLike \| null` |  | The end of a range ("9:00 – 10:00 AM"). Not with `date="now"`. |
| `timeZone` | `string` |  | Their IANA zone: the zone of the event or the person ("America/New_York"). |
| `localTimeZone` | `string` |  | The reader's IANA zone. Default: the runtime zone, known only after hydration. Pass it when the server knows it (a profile setting): then the full text renders on the server. |
| `hourCycle` | `HourCycle` |  | `12` ("3:00 PM") or `24` ("15:00"). Default: the locale's cycle. |
| `locale` | `string` |  | The BCP 47 tag. Default: the `DisplayLocaleProvider` locale, else "en-US". |
| `now` | `number \| Date` |  | A fixed now for `date="now"` (tests, stories): no clock runs. |
| `labels` | `Partial<LocalTimeLabels>` |  | The words, to translate them (`LOCAL_TIME_LABELS` of `#/lib/time-zone-format`). |
| `children` | `ReactNode` |  | A `LocalTimeEmpty` part: the words of no value. With a value, they are not drawn. |

### LocalTimeEmpty

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `data-slot` | `string` |  | The `data-slot` of the root: the item's own slot (`"time-ago"`). Default `"empty-value"`. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| LocalTime | `local-time` |  |  |  |
| LocalTimeEmpty | `local-time-empty` |  |  |  |

## Usage

Pass the moment and the zone of the person. Put a `LocalTimeEmpty` inside for a call that is not booked yet.

```tsx title="next-calls.tsx"
import { LocalTime, LocalTimeEmpty } from "@/components/ui/local-time";

const CLIENTS: { name: string; timeZone: string; nextCall: string | null }[] = [
  { name: "Aiko Tanaka", timeZone: "Asia/Tokyo", nextCall: "2026-11-13T09:00" },
  { name: "Marcus Webb", timeZone: "America/New_York", nextCall: "2026-11-13T14:30" },
  { name: "Sofia Rossi", timeZone: "Europe/Rome", nextCall: null },
];

export function NextCalls() {
  return (
    <ul className="flex flex-col gap-1 text-sm">
      {CLIENTS.map((client) => {
        return (
          <li key={client.name} className="flex justify-between gap-6">
            {client.name}
            <LocalTime date={client.nextCall} timeZone={client.timeZone}>
              <LocalTimeEmpty>Not booked</LocalTimeEmpty>
            </LocalTime>
          </li>
        );
      })}
    </ul>
  );
}
```

## 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/local-time
```

It adds 43 registry items: 40 files, 7379 lines, and the npm packages `@base-ui/react`, `@internationalized/date`, `@mantine/hooks`, `clsx`, `react-aria-components`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Clock](https://gelatinui.com/components/clock.md)
- [Date Display](https://gelatinui.com/components/date-display.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

- [Clock](https://gelatinui.com/components/clock.md)
- [Date Display](https://gelatinui.com/components/date-display.md)
- [Time Zone Select](https://gelatinui.com/components/time-zone-select.md)

## Motion

| Part | Motion |
| --- | --- |
| Your time | fade · the text that comes after hydration fades in once |
