Created
January 30, 2019 09:39
-
-
Save fonkadelic/edcff1c1884267f8bc2a1e0ef83e6c43 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
let now = Date() | |
func format(withIdentifier identifier: String) -> String { | |
let dateFormatter = DateFormatter() | |
dateFormatter.locale = Locale(identifier: identifier) | |
dateFormatter.setLocalizedDateFormatFromTemplate("EEEE, MMMM d, yyyy") | |
return dateFormatter.string(from: now) | |
} | |
format(withIdentifier: "de_DE") | |
format(withIdentifier: "en_US") | |
format(withIdentifier: "ja_JP") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment