title: Ruby strptime not working while reading file
body: <p>I have the following code:</p>
  
  <pre><code>require 'date'
  
  f = File.open(filepath)
  
  f.each_with_index do |line, i|
      a, b = line.split("\t")
      d = DateTime.strptime(a, '%m/%d/%Y %I:%M %p')
      puts "#{a} --- #{b}"
      break unless i &lt; 100
  end
  </code></pre>
  
  <p>And I'm getting the following error:</p>
  
  <pre><code>c_reader.rb:10:in `strptime': invalid date (ArgumentError)
    from c_reader.rb:10:in `block in &lt;main&gt;'
    from c_reader.rb:6:in `each'
    from c_reader.rb:6:in `each_with_index'
    from c_reader.rb:6:in `&lt;main&gt;'
  </code></pre>
  
  <p>The file content:</p>
  
  <pre>
  1/30/2014 1:00 AM   1251.6  
  1/30/2014 2:00 AM   1248  
  1/30/2014 3:00 AM   1246.32  
  1/30/2014 4:00 AM   1242.96  
  1/30/2014 5:00 AM   1282.08  
  1/30/2014 6:00 AM   1293.84  
  1/30/2014 7:00 AM   1307.04  
  1/30/2014 8:00 AM   1337.76  
  1/30/2014 9:00 AM   1357.92  
  </pre>
  
  <p>If I type this into IRB, it works perfect:</p>
  
  <pre><code>DateTime.strptime("1/30/2014 2:00 PM", '%m/%d/%Y %I:%M %p')
  </code></pre>
  
  <p>can someone please tell me what's going on here?</p>