export function getDatabaseTime(t: string | number | Date) {
  return formatDate2String(new Date(t))
}

export function formatTimestamp(t: string) {
  return getDatabaseTime(1000 * parseInt(t))
}

export function formatDate2String(d: Date) {
  return d.toLocaleString().replace(/\//g, '-')
}
