Loading...
Please waitLoading...
Please waitpnpm dlx uselab@latest add use-clock
import { useClock } from "@/hooks/use-clock"
export function Component() {
const time = useClock({
locale: "en-US",
formatOptions: {
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
hour12: true,
},
})
return (
<div>
<p>Current time: {time}</p>
</div>
)
}| Name | Type | Description |
|---|---|---|
time | string | The current time formatted as HH:mm:ss. |
00:40:17
Current Time