title: Spark SQL converting string to timestamp
body: <p>I'm new to Spark SQL and am trying to convert a string to a timestamp in a spark data frame. I have a string that looks like <code>'2017-08-01T02:26:59.000Z'</code> in a column called time_string</p>
  
  <p>My code to convert this string to timestamp is</p>
  
  <pre><code>CAST (time_string AS Timestamp)
  </code></pre>
  
  <p>But this gives me a timestamp of <code>2017-07-31 19:26:59</code></p>
  
  <p>Why is it changing the time? Is there a way to do this without changing the time?</p>
  
  <p>Thanks for any help!</p>