Command Palette

Search for a command to run...

Timezone

shadcn/ui

Display the current timezone and relative time from a given timestamp.

import { Timezone } from "@/registry/optics/timezone";import { Button } from "@/registry/optics/button";<Timezone 	timestamp={Date.now() - 5 * 60 * 1000} 	asChild	side="top"	sideOffset={4}>	<Button variant="raised">Open Timezone</Button></Timezone>

Installation

pnpm dlx shadcn@latest add https://optics.agusmayol.com.ar/r/timezone.json

Props

<Timezone />
Name
Type
timestamp
string | number (required)
asChild
boolean (default: false)
children
ReactNode (required)
className
string
side
"top" | "right" | "bottom" | "left"
sideOffset
number (default: 0)
...props
TooltipContentProps (align, alignOffset, etc.)