import { format, parseISO } from "date-fns"
import { toZonedTime } from "date-fns-tz"

export const formatDate = (dateString: string | undefined) => {
    if (!dateString) return

    const date = parseISO(dateString)
    const utcDate = toZonedTime(date, 'UTC')
    return format(utcDate, 'dd/MM/yyyy')
  }