Check out example codes for "swift get current time". It will help you in understanding the concepts better.

Code Example 1

let date = Date()
let calendar = Calendar.current
let hour = calendar.component(.hour, from: date)
let minutes = calendar.component(.minute, from: date)

Learn ReactJs, React Native from akashmittal.com