Answers for "get hours from time in swift"

0

swift get current hour

let formatter = DateFormatter()
formatter.dateFormat = "hh a" // "a" prints "pm" or "am"
let hourString = formatter.string(from: Date()) // "12 AM"
Posted by: Guest on June-09-2020
0

swift get current hour

let hour = Calendar.current.component(.hour, from: Date())
Posted by: Guest on June-09-2020

Code answers related to "get hours from time in swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language