title: How can I decode date string to Date object from JSON?
body: <p>How can I decode timestamp to Date from JSON?</p>
  
  <p>I get my date from the server as Json like this:</p>
  
  <pre><code>{
  
          "date": "2610-02-16T03:16:15.143Z"
  
      }
  </code></pre>
  
  <p>and im trying to build a Date class from it:</p>
  
  <pre><code>class Message : Decodable {
  
    var date: Date
  
  }
  </code></pre>
  
  <p>its not working as Expected I am getting this error:</p>
  
  <pre><code>Failed to fetch messages: typeMismatch(Swift.Double, Swift.DecodingError.Context(codingPath: [_JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "date", intValue: nil)], debugDescription: "Expected to decode Double but found a string/data instead.", underlyingError: nil))
  </code></pre>