title: Ruby - Convert formatted date to timestamp
body: <p>I need to convert a date string to the Unix timestamp format.
  The string I get from an API looks like:</p>
  
  <pre><code>2015-05-27T07:39:59Z
  </code></pre>
  
  <p>with <code>.tr()</code> i get:</p>
  
  <pre><code>2015-05-27 07:39:59
  </code></pre>
  
  <p>which is a pretty regular date format. Nonetheless, Ruby isn't able to convert it to Unix TS format. I tried <code>.to_time.to_i</code> but I keep getting <code>NoMethodError</code> Errors.</p>
  
  <p>In PHP the function <code>strtotime()</code> just works perfectly for this.
  Is there some similar method for Ruby?</p>