title: Swift3- How to get only time from UIDatePicker
body: <p>I'm trying to create an alarm clock app for iOS, Im new to Swift. I want to know how to get only the time from  the UIDatePicker. Till now, I have a code which just gives the entire date with time. 
  `import UIKit</p>
  
  <p>class ViewController: UIViewController {</p>
  
  <pre><code>@IBOutlet weak var alarmTime: UIDatePicker!
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  @IBAction func alarmTime(_ sender: UIDatePicker){
   sender.datePickerMode = UIDatePickerMode.time
      print(sender.date)
  }
  </code></pre>
  
  <p>}
  `
  <a href="https://i.stack.imgur.com/BmSyu.png" rel="nofollow noreferrer">Here is the screenshot of the output of the above code in the terminal</a></p>