Last active
August 29, 2015 14:08
-
-
Save alexk1350/4f2f391867820f9760ef to your computer and use it in GitHub Desktop.
Swift Date Formatting
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 getCurrentTime() -> String { | |
let currentDate = NSDate() | |
let dateFormatter = NSDateFormatter() | |
dateFormatter.dateFormat = "H" | |
var currentTime = dateFormatter.stringFromDate(date) | |
return currentTime | |
} | |
getCurrentTime() | |
//Additional Time Options | |
//y - year, d - day, m - month, E - weekday, a - AM or PM, h - hour, m -minute, s -second, z- timezone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment