Skip to content

Instantly share code, notes, and snippets.

@m1entus
Created July 23, 2014 08:01
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save m1entus/2b87b2ac70f25bbdf0b6 to your computer and use it in GitHub Desktop.
Save m1entus/2b87b2ac70f25bbdf0b6 to your computer and use it in GitHub Desktop.
Swift NSDateFormatter singleton
class var userDateFormatter : NSDateFormatter {
struct Static {
static let instance: NSDateFormatter = {
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
return dateFormatter
}()
}
return Static.instance
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment