diff --git a/SwiftyInsta/Local/Responses/ThreadResponse.swift b/SwiftyInsta/Local/Responses/ThreadResponse.swift index 861c3b1..d5712b2 100644 --- a/SwiftyInsta/Local/Responses/ThreadResponse.swift +++ b/SwiftyInsta/Local/Responses/ThreadResponse.swift @@ -57,7 +57,7 @@ public struct Message: ItemIdentifiableParsedResponse, UserIdentifiableParsedRes public var sentAt: Date { return rawResponse.timestamp .double - .flatMap { $0 > 9_999_999_999 ? $0/1_000 : $0 } + .flatMap { $0 / pow(10.0, max(floor(log10($0)) - 9, 0)) } .flatMap { Date(timeIntervalSince1970: $0) } ?? .distantPast } /// The `text` value.