Skip to content

Add timestamp formatting#54

Open
kittenwarrior-qb wants to merge 6 commits intoSamarth2190:mainfrom
kittenwarrior-qb:add_timestamp_formatting
Open

Add timestamp formatting#54
kittenwarrior-qb wants to merge 6 commits intoSamarth2190:mainfrom
kittenwarrior-qb:add_timestamp_formatting

Conversation

@kittenwarrior-qb
Copy link
Copy Markdown
Contributor

Formats a given timestamp into a readable date string.

Usage: formatTimestamp(timestamp: number, format?: 'date' | 'time' | 'relative' | 'monthDate'): string

formatTimestamp(1719380472000, 'date'); // "2024-06-26"
formatTimestamp(1719380472000, 'time'); // "17:21:12"
formatTimestamp(1719380472000, 'relative'); // 11 days ago
formatTimestamp(Date.now(), 'relative'); // "just now"
formatTimestamp(1896230400000, 'monthDate'); // "February 1 2030"

@michaelvbend
Copy link
Copy Markdown
Collaborator

Lots of conflics. Please resolve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants