query orders by date AND time in craft commerce How can I query all completed orders within the last hour? It seems craft is only comparing a date by YYYY-MM-DD.

Following query collects all orders from the same day, as {{dateFrom}} would output 2017-10-13 and not eg. 2017-10-13 11:22:08

{% set dateFrom = now|date_modify('-3600 seconds') %}
{% for order in craft.commerce.orders.dateOrdered( '&gt;= ' ~ dateFrom) %}
  ...
{% endfor %}


adding something like 
craft.commerce.orders.dateOrdered( '&gt;= ' ~ dateFrom|date('c')) would find any orders at all.
'&gt;= ' ~ dateFrom|date('c')


is correct to output the DateTime object as a string with the time (and timezone) included. If you don’t use the filter it’s output in the Y-m-d format by default.

So my recommendation would be to double check what dateFrom|date('c') actually outputs and to compare it with the dateOrdered values in the CP or database.