fix(agent-assignment): 소속 시각 UTC 변환을 적용한다

This commit is contained in:
2026-04-13 11:23:25 +09:00
parent 08ba6a6046
commit f357d426d0
4 changed files with 87 additions and 7 deletions

View File

@@ -2,6 +2,10 @@ package kr.co.vividnext.sodalive.extensions
import java.time.Duration
import java.time.LocalDateTime
import java.time.ZoneId
private val DEFAULT_KST_ZONE_ID: ZoneId = ZoneId.of("Asia/Seoul")
private val UTC_ZONE_ID: ZoneId = ZoneId.of("UTC")
fun LocalDateTime.getTimeAgoString(): String {
val now = LocalDateTime.now()
@@ -16,3 +20,9 @@ fun LocalDateTime.getTimeAgoString(): String {
else -> "${duration.toDays() / 365}년전"
}
}
fun LocalDateTime.convertToUtc(timeZone: ZoneId = DEFAULT_KST_ZONE_ID): LocalDateTime {
return atZone(timeZone)
.withZoneSameInstant(UTC_ZONE_ID)
.toLocalDateTime()
}