feat(time): 프로젝트 전체 시간 KST(UTC+9) 통일

- app/timezone.py 신설: KST 고정오프셋(+9, DST 없음) + now_kst/today_kst/to_kst_iso
- DB 직렬화 created_at/updated_at/decided_at/uploaded_at 표시를 UTC→KST 로 변환
  (expense/cupang/vacation db.py)
- _now_iso(JSON 저장) KST 기준
- 라우터 date.today()/datetime.now() → today_kst()/now_kst() (달력 '오늘'/엑셀 파일명)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 08:48:28 +09:00
parent 32fc12e283
commit fa1027fa1b
9 changed files with 80 additions and 30 deletions
+4 -2
View File
@@ -18,6 +18,8 @@ from typing import Any
from psycopg.rows import dict_row
from psycopg_pool import ConnectionPool
from app.timezone import KST
from .store import CATEGORIES, METHODS, STATUSES
@@ -364,7 +366,7 @@ class ExpenseDBStore:
out = dict(row)
v = out.get("uploaded_at")
if isinstance(v, datetime):
out["uploaded_at"] = v.astimezone(timezone.utc).isoformat(timespec="seconds")
out["uploaded_at"] = v.astimezone(KST).isoformat(timespec="seconds")
out["size_bytes"] = int(out.get("size_bytes", 0))
return out
@@ -468,7 +470,7 @@ class ExpenseDBStore:
for k in ("created_at", "updated_at", "decided_at"):
v = out.get(k)
if isinstance(v, datetime):
out[k] = v.astimezone(timezone.utc).isoformat(timespec="seconds")
out[k] = v.astimezone(KST).isoformat(timespec="seconds")
out["amount"] = int(out.get("amount", 0))
return out