How can I convert string date to NSDate?
<p>I want to convert <code>2016-03-09 00:00:00</code> to <code>09/03/2016</code></p>

<p>I am try below code but print <code>nil</code> value</p>

<pre><code>var date: [String] = ["2016-03-09 00:00:00", "2016-03-20 00:00:00"]

for i in date {
    let dateFormatter = NSDateFormatter()
    dateFormatter.dateFormat = "dd/MM/YYYY"
    let showDate = dateFormatter.dateFromString(i)
    print(showDate)
}
</code></pre>

<p>above code print <code>nil</code><br>
pls help me how to print date <code>dd/MM/YYYY</code> format in swift</p>