title: Swift 3 changing date format
body: <p>I want to get my Date in DD.MM.YYYY HH:mm:ss as a String. </p>
  
  <p>I use the following extension:</p>
  
  <pre><code>extension Date {
  var localTime: String {
      return description(with: Locale.current)
      }
  }
  </code></pre>
  
  <p>and the following code when my datePicker changes:</p>
  
  <pre><code>@IBAction func datePickerChanged(_ sender: UIDatePicker) {
      dateLabel.text = datePicker.date.localTime
      let formatter = DateFormatter()
      formatter.dateFormat = "dd.MM.yyyy hh:mm"
      let TestDateTime = formatter.date(from: datePicker.date.localTime)
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>