title: How do I get the current Date in short format in Swift
body: <p>In the images below you can see the code I wrote and the values of all the variables:</p>
  
  <pre><code>class fun getCurrentShortDate() -&gt; String {
      var todaysDate = NSDate()
      var dateFormatter = NSDateFormatter()
      dateFormatter.dateFormat = "dd-MM-yyyy"
      var DateInFormat = dateFormatter.stringFromDate(todaysDate)
  
      return DateInFormat
  }
  </code></pre>
  
  <p><a href="https://i.imgur.com/ydEnMEq.png" rel="noreferrer">Variable values</a> </p>
  
  <p>As you can see the current date is found no problem, but when I try to change the NSDate to a string, it just won't do it. </p>