Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift get current hour

let formatter = DateFormatter()
formatter.dateFormat = "hh a" // "a" prints "pm" or "am"
let hourString = formatter.string(from: Date()) // "12 AM"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #current #hour
ADD COMMENT
Topic
Name
7+3 =