Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

formatDate.ts

10 lines219 Bytes

1function formatDate(date: string) {
2 return new Intl.DateTimeFormat('en-GB', {
3 year: 'numeric',
4 month: 'short',
5 day: '2-digit',
6 timeZone: 'UTC',
7 }).format(new Date(date))
8}
9​
10export default formatDate