import { addMinutes, format, parseISO } from 'date-fns';

export function formatUTCDateToClientTimezone(date: string) {
  const dateTZ = addMinutes(
    parseISO(date),
    new Date().getTimezoneOffset() * -1
  );
  return format(dateTZ, 'yyyy-MM-dd HH:mm:ss');
}

export function formatUTCDateToGermanLocaleAndTimezone(date: string) {
  const dateTZ = addMinutes(
    parseISO(date),
    new Date().getTimezoneOffset() * -1
  );
  return format(dateTZ, 'dd.MM.yy HH:mm:ss');
}
