diff --git a/Modules/XDateUtil/Sources/DateFormat.swift b/Modules/XDateUtil/Sources/DateFormat.swift index 913e24e7..3fd3a747 100644 --- a/Modules/XDateUtil/Sources/DateFormat.swift +++ b/Modules/XDateUtil/Sources/DateFormat.swift @@ -1,8 +1,10 @@ import Foundation public enum DateFormat: String { + /// yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS + case fullDateWithMilliSecondTime = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS" /// yyyy-MM-dd'T'HH:mm:ss - case fullDateWithTime = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS" + case fullDateWithTime = "yyyy-MM-dd'T'HH:mm:ss" /// yyyy-MM-dd case fullDate = "yyyy-MM-dd" /// yyyy diff --git a/Modules/XDateUtil/Sources/StringToDate.swift b/Modules/XDateUtil/Sources/StringToDate.swift index 5f0bfbfb..e25daf89 100644 --- a/Modules/XDateUtil/Sources/StringToDate.swift +++ b/Modules/XDateUtil/Sources/StringToDate.swift @@ -4,6 +4,7 @@ public extension String { func toDate(format: DateFormat) -> Date { XDateFormatter.shared.dateFormat = format.rawValue guard let returnDate = XDateFormatter.shared.date(from: self) else { + print("toDate Error: Date로 format하려는 데이터의 형식이 DateFormat과 일치하지 않습니다.") return Date() } return returnDate diff --git a/Services/AuthService/Sources/Data/Local/DataSource/LoaclTokenDataSourceImpl.swift b/Services/AuthService/Sources/Data/Local/DataSource/LoaclTokenDataSourceImpl.swift index 80d30428..d50a349d 100644 --- a/Services/AuthService/Sources/Data/Local/DataSource/LoaclTokenDataSourceImpl.swift +++ b/Services/AuthService/Sources/Data/Local/DataSource/LoaclTokenDataSourceImpl.swift @@ -32,7 +32,7 @@ class LoaclTokenDataSourceImpl: LoaclTokenDataSource { } func fetchExpiredDate() -> Date? { - self.keychain.get(.expiredAt)?.toDate(format: .fullDateWithTime) + self.keychain.get(.expiredAt)?.toDate(format: .fullDateWithMilliSecondTime) } func resetToken() {