title: Swift json time value to local time zone
body: <p>I have a json request that can produce two different types of time values.  Both ways it is in UTC time but I need to convert it to local time.</p>
  
  <pre><code>2015-12-01T13:05:33+00:00
  </code></pre>
  
  <p>or</p>
  
  <pre><code>1:05:33 PM
  </code></pre>
  
  <p>My attempt.</p>
  
  <pre><code>let dateFormatter = NSDateFormatter()
  dateFormatter.timeStyle = NSDateFormatterStyle.ShortStyle //Set time style
  dateFormatter.timeZone = NSTimeZone()
  let localDate: NSDate? = dateFormatter.dateFromString(time1)
  print(localDate)
  </code></pre>
  
  <p>This what I get a as a result. 2000-01-01 19:05:33 +0000 if I use the 1:05:18 PM value.</p>
  
  <p>The line for getting the json value.</p>
  
  <pre><code>let time1 = json["results"]["time1"].string!
  </code></pre>