채팅 메세지를 표시하려는데 현재 시간이랑 맞지 않아서 supabase 테이블을 확인 한 결과
9시간이 차이가 나게 기록

export const formatDateToHours = (isoDate: number) => {
const date = new Date(isoDate);
const hours = String(date.getUTCHours()).padStart(2, "0");
const minutes = String(date.getUTCMinutes()).padStart(2, "0");
return ${hours}:${minutes};
};
export const formatDateToYears = (isoDate: number) => {
const date = new Date(isoDate);
const year = date.getUTCFullYear();
const month = String(date.getUTCMonth() + 1).padStart(2, "0"); // 월은 0부터 시작
const day = String(date.getUTCDate()).padStart(2, "0");
return ${year}.${month}.${day};
};
export const formatDateToHours = (isoDate: string): string => {
const localDate = new Date(isoDate);
const options: Intl.DateTimeFormatOptions = { timeZone: "Asia/Seoul", hour: "2-digit", minute: "2-digit" };
return localDate.toLocaleTimeString("ko-KR", options);
};
export const formatDateToYears = (isoDate: string): string => {
const localDate = new Date(isoDate);
const options: Intl.DateTimeFormatOptions = {
timeZone: "Asia/Seoul",
year: "numeric",
month: "2-digit",
day: "2-digit",
};
const formattedDate = localDate.toLocaleDateString("ko-KR", options);
return formattedDate.replace(/./g, ".");
};
나는 미친 사람이다!! 할 수 있다.
다시 다짐해가며 운동을 시작하자