diff --git a/PostHog/Utils/DateUtils.swift b/PostHog/Utils/DateUtils.swift index 2f7f1ecd1..d16f6cc8d 100644 --- a/PostHog/Utils/DateUtils.swift +++ b/PostHog/Utils/DateUtils.swift @@ -12,11 +12,10 @@ private func newDateFormatter() -> DateFormatter { dateFormatter.locale = Locale(identifier: "en_US_POSIX") dateFormatter.timeZone = TimeZone(abbreviation: "UTC") - dateFormatter.dateFormat = "yyyy-MM-dd'T'hh:mm:ss.SSS'Z'" // Use 'hh' for 12-hour clock + dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" return dateFormatter } -// returns 2024-02-09T10:53:53.781Z public func toISO8601String(_ date: Date) -> String { let dateFormatter = newDateFormatter() return dateFormatter.string(from: date)