Created
March 29, 2016 21:35
-
-
Save ArthurYidi/75c3d66f0fa1f7ddbb61e6fd7380fc02 to your computer and use it in GitHub Desktop.
NSDate to String
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
func formatDate(date: NSDate, format: String = "yyyy-MM-dd hh:mm:ss Z") -> String { | |
let formatter = NSDateFormatter() | |
formatter.dateFormat = format | |
return formatter.stringFromDate(date) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment