Skip to content

Instantly share code, notes, and snippets.

@alexk1350
alexk1350 / Swift Date Formatting
Last active August 29, 2015 14:08
Swift Date Formatting
func getCurrentTime() -> String {
let currentDate = NSDate()
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "H"
var currentTime = dateFormatter.stringFromDate(date)
return currentTime
}