title: Date Formatter is not working
body: <p>I have this  string </p>
  
  <p>let myDate = "10 Jan 2018 06:31:01 PM"</p>
  
  <p>I want to convert it in two string</p>
  
  <ol>
  <li><p>date(dd)</p></li>
  <li><p>month and year(MMM yyyy)</p></li>
  </ol>
  
  <p>for this I'm using this code </p>
  
  <pre><code>let timeFormatter = DateFormatter()
   //first converting string into date
  
   timeFormatter.dateFormat = "dd MM yyyy hh:mm:ss a"
   let date = timeFormatter.date(from: myDate)
   // date into string
  
   let str = timeFormatter.string(from: date!)
   print(str )
   // know changing resultant string into desire format 
  
   timeFormatter.dateFormat = "dd"
   let strdate = timeFormatter.date(from: str)
   timeFormatter.dateFormat = "MMM yyyy"
   let fullDate = timeFormatter.date(from: str)
   cell.lblFullDate.text = "\(String(describing: strdate))"
   cell.lblDate.text = "\(String(describing: fullDate))"
  </code></pre>
  
  <p>when I run it, compiler get stuck on this line </p>
  
  <pre><code>let date = timeFormatter.date(from: myDate)
  </code></pre>
  
  <p>because this  date formate is not correct</p>
  
  <pre><code>timeFormatter.dateFormat = "dd MM yyyy hh:mm:ss a"
  </code></pre>
  
  <p>what DateFormatter should I use for this?</p>