import { formatInTimeZone } from 'date-fns-tz';

export const formatDate = (
  date: Date | string,
  formatStr: string = 'dd.MM.yyyy HH:mm',
) => {
  const utcDate = new Date(date);
  return formatInTimeZone(utcDate, 'UTC', formatStr);
};
