A shadcn-style time formatting utility built with Ark UI primitives.

12-hour clock5:35 PM
12-hour with seconds5:35:00 PM
24-hour clock17:35

Installation

npx shadcn@latest add @ark-cn/format

Usage

import { FormatTime } from "@/components/ui/format"

Examples

Default

12-hour clock5:35 PM
12-hour with seconds5:35:00 PM
24-hour clock17:35

API reference

This utility mirrors Ark UI's time formatter. The ark-cn file exports it both as FormatTime and as Format.Time.

See the ARK UI documentation for the full API.