현재 로케일과 시간대 적용

This commit is contained in:
Yu Sung
2026-01-05 14:53:20 +09:00
parent f855ca55ca
commit fa4483cd18
2 changed files with 4 additions and 3 deletions

View File

@@ -11,7 +11,8 @@ extension Date {
func convertDateFormat(dateFormat: String = "yyyy.MM.dd") -> String {
let formatter = DateFormatter()
formatter.dateFormat = dateFormat
formatter.locale = Locale(identifier: "ko")
formatter.locale = Locale.autoupdatingCurrent
formatter.timeZone = TimeZone.current
return formatter.string(from: self)
}