Created
April 3, 2017 06:21
-
-
Save emahiro/fd7fa2480ac10550e108331c61684d3c to your computer and use it in GitHub Desktop.
ISO8601の形式をswiftのDate型で扱う
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
private static let ISO8601Formatter: DateFormatter = { | |
let dateFormatter = DateFormatter() | |
dateFormatter.locale = Locale(identifier: "en_US_POSIX") | |
dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) | |
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZ" | |
return dateFormatter | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment