How to convert date format from dd/MM/YYYY to YYYY-MM-dd in swift
<p>I tired to covert from <strong>21/07/2016</strong> to 2<strong>016-07-21</strong> but got this date <strong>2015-12-20</strong> <br>
Here is the Code that i have try</p>

<pre><code>let inputFormatter = NSDateFormatter()
inputFormatter.dateFormat = "MM/dd/YYYY"

let outputFormatter = NSDateFormatter()
outputFormatter.dateFormat = "YYYY-MM-dd"

let showDate = inputFormatter.dateFromString("07/21/2016")
let resultString = outputFormatter.stringFromDate(showDate!)

print(resultString)
</code></pre>

<p>How to convert?<br>
Thank you</p>