Skip to content

Commit

Permalink
FIX: 항상 한국시간을 기준으로 Date get 하게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloperRyou committed Aug 14, 2023
1 parent e376736 commit 605db3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/date.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
function getCurrentDate(addSeconds = false) {
const now = new Date();
const curr = new Date();
const utc = curr.getTime() + curr.getTimezoneOffset() * 60 * 1000;
const KR_TIME_DIFF = 9 * 60 * 60 * 1000;
const now = new Date(utc + KR_TIME_DIFF);
const year = now.getFullYear().toString();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
Expand Down

0 comments on commit 605db3f

Please sign in to comment.