Skip to content

Instantly share code, notes, and snippets.

@mminer
Last active October 18, 2017 04:50
Show Gist options
  • Save mminer/67c3791ebb4097766b4234010b5443ae to your computer and use it in GitHub Desktop.
Save mminer/67c3791ebb4097766b4234010b5443ae to your computer and use it in GitHub Desktop.
Swift ISO 8601 date formatter.
import Foundation
let iso8601Formatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
return formatter
}()
@mminer
Copy link
Author

mminer commented Oct 18, 2017

This is unnecessary as of macOS 10.12 and iOS 10 with the addition of ISO8601DateFormatter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment