File size: 163 Bytes
f27679f
 
 
 
 
1
2
3
4
5
import { formatDistance } from 'date-fns'

export function formatTimeAgo(time: string) {
  return formatDistance(new Date(time), new Date(), { addSuffix: true })
}