title: Converting timestamp to a different timezone (Swift)
body: <p><strong>What I want to do:</strong>
  Take the timestamp from my database and convert it to the timezone of the user.</p>
  <p><strong>My code:</strong></p>
  <pre><code>let tryItNow = &quot;\(model.timestampName)&quot;
          
  let format = DateFormatter()       
  let date = format.date(from: tryItNow)       
  format.timeZone = .current       
  format.dateFormat = &quot;yyyy-MM-dd HH:mm:ss Z&quot;       
  let dateString = format.string(from: date!)   //Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
  print(dateString)
  </code></pre>
  <p><strong>The problem:</strong> I guess Xcode tells me, that <code>date</code> is empty, which can't really be true. I get the timestamp from a struct and this whole thing is in a function, that's why its called <code>model.timestampName</code>.</p>
  <p><strong>What I tried:</strong> Searching on the internet, here on stack overflow (most tutorials are 3 years old and I did not find anything for my specific case).</p>