Frontendx
README.md
SOLUTION.md
main.tsxentry
App.tsx
App.css
index.html
vite.config.ts
Installed
react@^19.2.0
react-dom@^19.2.0

Time in Human Readable Format in React

Prompt

Build a component that converts a timestamp or duration into human-readable relative time (e.g. '2 hours ago' '3 days ago' 'just now'). Updates automatically every minute to stay current. Similar to social media post timestamps.

Compute diff = Date.now() - timestamp. Use if
Test Results

Time in Human Readable Format in React

Build a component that converts a timestamp or duration into human-readable relative time (e.g. '2 hours ago' '3 days ago' 'just now'). Updates automatically every minute to stay current. Similar to social media post timestamps.