라이브 시작시간 UTC 적용

라이브 상세와 수정 화면에서 UTC 기준 시간을 표시한다.
날짜 표기는 OS 언어 설정의 기본 포맷을 사용한다.
This commit is contained in:
Yu Sung
2026-01-05 11:36:26 +09:00
parent 921c7e008c
commit 2f8331f2ff
5 changed files with 34 additions and 7 deletions

View File

@@ -15,6 +15,16 @@ extension Date {
return formatter.string(from: self)
}
func localizedDateTimeString(dateStyle: DateFormatter.Style = .medium,
timeStyle: DateFormatter.Style = .short) -> String {
let formatter = DateFormatter()
formatter.dateStyle = dateStyle
formatter.timeStyle = timeStyle
formatter.locale = Locale.autoupdatingCurrent
formatter.timeZone = TimeZone.current
return formatter.string(from: self)
}
func currentTimeMillis() -> Int64 {
return Int64(self.timeIntervalSince1970 * 1000)
}