Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
import Foundation
struct Formatter {
static let formatter = DateFormatter()
static func date(from string: String) -> Date? {
formatter.dateFormat = "d MMM yyyy"
return formatter.date(from: string)
}
}
let dateStrings = ["10 Oct 1988", "11 Jan 1947", "28 Mar 2002"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment