title: Time conversion Ruby on Rails 4 not working
body: <p>Part of my logic for sending an email to a supplier is that the promise date must be less than today's date in order to send the email. For whatever reason, it is passing as true even though it should be false. I test it in the console and it shows false, but it sends the email... so I am guessing it is passing as true.</p>
  
  <pre><code>def self.send_vendor_openorder_notification(user, vendor)
      po_collection = Array.new
      user.purchase_orders.where({open_order: true, vendor_number: vendor.vendor_number}).where.not(email_last_sent: Time.now.midnight).each do |x|
        if x.promise_date == nil || DateTime.strptime(x.promise_date, '%m/%d/%y') + 7.hours &lt; Time.now.midnight
          if x.email_sent == false
            po_collection &lt;&lt; x.id
            x.email_sent = true
            x.email_last_sent = Time.now.midnight
            x.save
          end
        end
      end
      if po_collection.empty? == false
        VendorSender.open_order_sender(user, vendor, po_collection).deliver_later
      end
    end
  </code></pre>
  
  <p>Here if promise_date is nil or less than today at midnight, it should pass. However, a promise date of "09/19/2016" is passing as true on 09/19/2016. In heroku console(this is deployed through Heroku), this is false... What am I missing here?</p>
  
  <pre><code>irb(main):038:0&gt; DateTime.strptime("09/19/16", '%m/%d/%y') + 7.hours &lt; Time.now.midnight
  =&gt; false
  irb(main):039:0&gt; DateTime.strptime("09/19/16", '%m/%d/%y') + 7.hours
  =&gt; Mon, 19 Sep 2016 07:00:00 +0000
  irb(main):040:0&gt; Time.now.midnight
  =&gt; 2016-09-19 00:00:00 -0700
  irb(main):041:0&gt; 
  </code></pre>