Skip to content

Instantly share code, notes, and snippets.

@NickAger
Created August 15, 2019 15:00
Show Gist options
  • Save NickAger/d4f303490a12df79c13d29fca9b7e9bd to your computer and use it in GitHub Desktop.
Save NickAger/d4f303490a12df79c13d29fca9b7e9bd to your computer and use it in GitHub Desktop.
private let dateFormatter:ISO8601DateFormatter = {
let formatter = ISO8601DateFormatter()
formatter.timeZone = TimeZone.current
formatter.formatOptions = [.withFullDate, .withFullTime, .withDashSeparatorInDate, .withColonSeparatorInTime, .withSpaceBetweenDateAndTime]
return formatter
}()
let date = dateFormatter.date(from: "2019-08-15 12:57:45 +0000")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment