Created
March 14, 2022 13:05
-
-
Save antocara/5944a5a9f9108cbd0bb170ec9afaea0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func formatResponseHeaderDate() -> Date?{ | |
let dateFormatter = DateFormatter() | |
dateFormatter.locale = Locale(identifier: "en_US_POSIX") // set locale to reliable US_POSIX | |
dateFormatter.dateFormat = "EEE,d MMM yyyy HH:mm:ss zzz" | |
dateFormatter.timeZone = TimeZone(abbreviation: "GMT") | |
return dateFormatter.date(from: self) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment