-
-
Save Pasanpr/b31e72fcc99bb928ecd783d64ec576c9 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
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