Timestamp comparison

Problem:
This is odd, if I search for hosts on the “All Hosts” page by last_report:

  1. last_report < "1 hour ago" correctly shows me four hosts which have the last report more than one hour ago.

  2. last_report > "1 hour ago" shows me “No entries found”. I should show all but the four.

  3. last_report < "60 minutes ago" again correctly shows me four hosts.

  4. last_report > "60 minutes ago" correctly shows me all hosts but those four.

Expected outcome:
last_report > "1 hour ago" should list all hosts except those with last_report older than one hour, just like last_report > "60 minutes ago" does.

Foreman and Proxy versions:
foreman-3.9.3-1.el8.noarch

Distribution and version:
AlmaLinux 8.9.

Searches with last_report < $time seem to work alright in both cases.

> puts Host.search_for('last_report < "60 minutes ago"').to_sql
SELECT "hosts".* FROM "hosts" WHERE "hosts"."type" = 'Host::Managed' AND (("hosts"."last_report" < '2024-05-10 08:01:20.826741')) ORDER BY "hosts"."name" ASC

> puts Host.search_for('last_report < "1 hour ago"').to_sql
SELECT "hosts".* FROM "hosts" WHERE "hosts"."type" = 'Host::Managed' AND (("hosts"."last_report" < '2024-05-10 08:01:27.773748')) ORDER BY "hosts"."name" ASC

Searches with last_report > $time seem to be doing something odd

> puts Host.search_for('last_report > "60 minutes ago"').to_sql
SELECT "hosts".* FROM "hosts" WHERE "hosts"."type" = 'Host::Managed' AND (("hosts"."last_report" >= '2024-05-10 08:02:07.603842')) ORDER BY "hosts"."name" ASC

> puts Host.search_for('last_report > "1 hour ago"').to_sql
SELECT "hosts".* FROM "hosts" WHERE "hosts"."type" = 'Host::Managed' AND (("hosts"."last_report" >= '2024-05-10 09:01:12.765462')) ORDER BY "hosts"."name" ASC

The one with hours seems to be one hour off. This seems to be related to timezone handling, if I force the timezone to be UTC, then the issue goes away.

Also it is slightly odd that it opts to use >= in the generated sql.