title: Converting String to Datetime Rails
body: <p>I'm using LazyHighCharts and trying to convert json data to display only the last 24hrs, I'm having some troubles converting the date and time ("2014-06-16 16:00:00") to milliseconds.</p>
  
  <p>data structure</p>
  
  <pre><code>{"status": "ok", "data": [{"2014-06-16 16:00:00": 24.2},{"2014-06-17 12:00:00": 30.2},{"2014-06-18 17:00:00": 42.9}]} etc
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>@data = JSON.parse(open(@temperature.url).read)
  
  dates = []
  temps = []
  
  @data['data'].each do |data|
   dates &lt;&lt; data.keys
   temps &lt;&lt; data.values
  end 
  
  datetime = dates.each do |d| DateTime.parse(d).to_i end
  
  @graph = LazyHighCharts::HighChart.new('graph') do |f|
   f.chart(:height =&gt; '400')
   f.yAxis [:title =&gt; {:text =&gt; "Temperature", :margin =&gt; 20, style: { color: '#333'}}]
   f.series(:pointInterval =&gt; 1.hour, :pointStart =&gt; 30.day.ago, :type =&gt; 'area', :name =&gt; '24hrs', :data =&gt; [[datetime, temps]])
   f.options[:xAxis] = { :minTickInterval =&gt; 24 * 3600 * 1000, :type =&gt; "datetime", :dateTimeLabelFormats =&gt; { day: "%b %e"}, :title =&gt; { :text =&gt; nil }, :labels =&gt; { :enabled =&gt; true } }
  end
  </code></pre>