## Describe the bug
On a 32 bit os like raspbian the HistoryQuery has a before …parameter. This parameter uses time().
The query builder converts this to microseconds and creates a integer overflow causing the query to use the wrong timestamp to compare and creates an empty history list
## To Reproduce
* Install Raspberry Pi OS 32 bit
* Install Icingadb-web and requirements
* History empty
* add logger to HistoryController after all filters are applied
* Logger::error(print_r($history->dump(),true));
* get strange timestamp in the past
```
Array
(
[0] => SELECT history.id, history.environment_id, history.endpoint_id, history.object_type, history.host_id, history.service_id, history.comment_history_id, history.downtime_history_id, history.flapping_history_id, history.notification_history_id, history.acknowledgement_history_id, history.state_history_id, history.event_type, history.event_time, history_host.id AS history_host_id, history_host.environment_id AS history_host_environment_id, history_host.name_checksum AS history_host_name_checksum, history_host.properties_checksum AS history_host_properties_checksum, history_host.name AS history_host_name, history_host.name_ci AS history_host_name_ci, history_host.display_name AS history_host_display_name, history_host.address AS history_host_address, history_host.address6 AS history_host_address6, history_host.address_bin AS history_host_address_bin, history_host.address6_bin AS history_host_address6_bin, history_host.checkcommand_name AS history_host_checkcommand_name, history_host.checkcommand_id AS history_host_checkcommand_id, history_host.max_check_attempts AS history_host_max_check_attempts, history_host.check_timeperiod_name AS history_host_check_timeperiod_name, history_host.check_timeperiod_id AS history_host_check_timeperiod_id, history_host.check_timeout AS history_host_check_timeout, history_host.check_interval AS history_host_check_interval, history_host.check_retry_interval AS history_host_check_retry_interval, history_host.active_checks_enabled AS history_host_active_checks_enabled, history_host.passive_checks_enabled AS history_host_passive_checks_enabled, history_host.event_handler_enabled AS history_host_event_handler_enabled, history_host.notifications_enabled AS history_host_notifications_enabled, history_host.flapping_enabled AS history_host_flapping_enabled, history_host.flapping_threshold_low AS history_host_flapping_threshold_low, history_host.flapping_threshold_high AS history_host_flapping_threshold_high, history_host.perfdata_enabled AS history_host_perfdata_enabled, history_host.eventcommand_name AS history_host_eventcommand_name, history_host.eventcommand_id AS history_host_eventcommand_id, history_host.is_volatile AS history_host_is_volatile, history_host.action_url_id AS history_host_action_url_id, history_host.notes_url_id AS history_host_notes_url_id, history_host.notes AS history_host_notes, history_host.icon_image_id AS history_host_icon_image_id, history_host.icon_image_alt AS history_host_icon_image_alt, history_host.zone_name AS history_host_zone_name, history_host.zone_id AS history_host_zone_id, history_host.command_endpoint_name AS history_host_command_endpoint_name, history_host.command_endpoint_id AS history_host_command_endpoint_id, history_host_state.host_id AS history_host_state_host_id, history_host_state.environment_id AS history_host_state_environment_id, history_host_state.state_type AS history_host_state_state_type, history_host_state.soft_state AS history_host_state_soft_state, history_host_state.hard_state AS history_host_state_hard_state, history_host_state.previous_soft_state AS history_host_state_previous_soft_state, history_host_state.previous_hard_state AS history_host_state_previous_hard_state, history_host_state.check_attempt AS history_host_state_check_attempt, history_host_state.severity AS history_host_state_severity, history_host_state.output AS history_host_state_output, history_host_state.long_output AS history_host_state_long_output, history_host_state.performance_data AS history_host_state_performance_data, history_host_state.normalized_performance_data AS history_host_state_normalized_performance_data, history_host_state.check_commandline AS history_host_state_check_commandline, history_host_state.is_problem AS history_host_state_is_problem, history_host_state.is_handled AS history_host_state_is_handled, history_host_state.is_reachable AS history_host_state_is_reachable, history_host_state.is_flapping AS history_host_state_is_flapping, history_host_state.is_overdue AS history_host_state_is_overdue, history_host_state.is_acknowledged AS history_host_state_is_acknowledged, history_host_state.acknowledgement_comment_id AS history_host_state_acknowledgement_comment_id, history_host_state.last_comment_id AS history_host_state_last_comment_id, history_host_state.in_downtime AS history_host_state_in_downtime, history_host_state.execution_time AS history_host_state_execution_time, history_host_state.latency AS history_host_state_latency, history_host_state.check_timeout AS history_host_state_check_timeout, history_host_state.check_source AS history_host_state_check_source, history_host_state.scheduling_source AS history_host_state_scheduling_source, history_host_state.last_update AS history_host_state_last_update, history_host_state.last_state_change AS history_host_state_last_state_change, history_host_state.next_check AS history_host_state_next_check, history_host_state.next_update AS history_host_state_next_update, history_service.id AS history_service_id, history_service.environment_id AS history_service_environment_id, history_service.name_checksum AS history_service_name_checksum, history_service.properties_checksum AS history_service_properties_checksum, history_service.host_id AS history_service_host_id, history_service.name AS history_service_name, history_service.name_ci AS history_service_name_ci, history_service.display_name AS history_service_display_name, history_service.checkcommand_name AS history_service_checkcommand_name, history_service.checkcommand_id AS history_service_checkcommand_id, history_service.max_check_attempts AS history_service_max_check_attempts, history_service.check_timeperiod_name AS history_service_check_timeperiod_name, history_service.check_timeperiod_id AS history_service_check_timeperiod_id, history_service.check_timeout AS history_service_check_timeout, history_service.check_interval AS history_service_check_interval, history_service.check_retry_interval AS history_service_check_retry_interval, history_service.active_checks_enabled AS history_service_active_checks_enabled, history_service.passive_checks_enabled AS history_service_passive_checks_enabled, history_service.event_handler_enabled AS history_service_event_handler_enabled, history_service.notifications_enabled AS history_service_notifications_enabled, history_service.flapping_enabled AS history_service_flapping_enabled, history_service.flapping_threshold_low AS history_service_flapping_threshold_low, history_service.flapping_threshold_high AS history_service_flapping_threshold_high, history_service.perfdata_enabled AS history_service_perfdata_enabled, history_service.eventcommand_name AS history_service_eventcommand_name, history_service.eventcommand_id AS history_service_eventcommand_id, history_service.is_volatile AS history_service_is_volatile, history_service.action_url_id AS history_service_action_url_id, history_service.notes_url_id AS history_service_notes_url_id, history_service.notes AS history_service_notes, history_service.icon_image_id AS history_service_icon_image_id, history_service.icon_image_alt AS history_service_icon_image_alt, history_service.zone_name AS history_service_zone_name, history_service.zone_id AS history_service_zone_id, history_service.command_endpoint_name AS history_service_command_endpoint_name, history_service.command_endpoint_id AS history_service_command_endpoint_id, history_service_state.service_id AS history_service_state_service_id, history_service_state.environment_id AS history_service_state_environment_id, history_service_state.state_type AS history_service_state_state_type, history_service_state.soft_state AS history_service_state_soft_state, history_service_state.hard_state AS history_service_state_hard_state, history_service_state.previous_soft_state AS history_service_state_previous_soft_state, history_service_state.previous_hard_state AS history_service_state_previous_hard_state, history_service_state.check_attempt AS history_service_state_check_attempt, history_service_state.severity AS history_service_state_severity, history_service_state.output AS history_service_state_output, history_service_state.long_output AS history_service_state_long_output, history_service_state.performance_data AS history_service_state_performance_data, history_service_state.normalized_performance_data AS history_service_state_normalized_performance_data, history_service_state.check_commandline AS history_service_state_check_commandline, history_service_state.is_problem AS history_service_state_is_problem, history_service_state.is_handled AS history_service_state_is_handled, history_service_state.is_reachable AS history_service_state_is_reachable, history_service_state.is_flapping AS history_service_state_is_flapping, history_service_state.is_overdue AS history_service_state_is_overdue, history_service_state.is_acknowledged AS history_service_state_is_acknowledged, history_service_state.acknowledgement_comment_id AS history_service_state_acknowledgement_comment_id, history_service_state.last_comment_id AS history_service_state_last_comment_id, history_service_state.in_downtime AS history_service_state_in_downtime, history_service_state.execution_time AS history_service_state_execution_time, history_service_state.latency AS history_service_state_latency, history_service_state.check_timeout AS history_service_state_check_timeout, history_service_state.check_source AS history_service_state_check_source, history_service_state.scheduling_source AS history_service_state_scheduling_source, history_service_state.last_update AS history_service_state_last_update, history_service_state.last_state_change AS history_service_state_last_state_change, history_service_state.next_check AS history_service_state_next_check, history_service_state.next_update AS history_service_state_next_update, history_comment.comment_id AS history_comment_comment_id, history_comment.environment_id AS history_comment_environment_id, history_comment.endpoint_id AS history_comment_endpoint_id, history_comment.object_type AS history_comment_object_type, history_comment.host_id AS history_comment_host_id, history_comment.service_id AS history_comment_service_id, history_comment.entry_time AS history_comment_entry_time, history_comment.author AS history_comment_author, history_comment.removed_by AS history_comment_removed_by, history_comment.comment AS history_comment_comment, history_comment.entry_type AS history_comment_entry_type, history_comment.is_persistent AS history_comment_is_persistent, history_comment.is_sticky AS history_comment_is_sticky, history_comment.expire_time AS history_comment_expire_time, history_comment.remove_time AS history_comment_remove_time, history_comment.has_been_removed AS history_comment_has_been_removed, history_downtime.downtime_id AS history_downtime_downtime_id, history_downtime.environment_id AS history_downtime_environment_id, history_downtime.endpoint_id AS history_downtime_endpoint_id, history_downtime.triggered_by_id AS history_downtime_triggered_by_id, history_downtime.parent_id AS history_downtime_parent_id, history_downtime.object_type AS history_downtime_object_type, history_downtime.host_id AS history_downtime_host_id, history_downtime.service_id AS history_downtime_service_id, history_downtime.entry_time AS history_downtime_entry_time, history_downtime.author AS history_downtime_author, history_downtime.cancelled_by AS history_downtime_cancelled_by, history_downtime.comment AS history_downtime_comment, history_downtime.is_flexible AS history_downtime_is_flexible, history_downtime.flexible_duration AS history_downtime_flexible_duration, history_downtime.scheduled_start_time AS history_downtime_scheduled_start_time, history_downtime.scheduled_end_time AS history_downtime_scheduled_end_time, history_downtime.start_time AS history_downtime_start_time, history_downtime.end_time AS history_downtime_end_time, history_downtime.has_been_cancelled AS history_downtime_has_been_cancelled, history_downtime.trigger_time AS history_downtime_trigger_time, history_downtime.cancel_time AS history_downtime_cancel_time, history_flapping.id AS history_flapping_id, history_flapping.environment_id AS history_flapping_environment_id, history_flapping.endpoint_id AS history_flapping_endpoint_id, history_flapping.object_type AS history_flapping_object_type, history_flapping.host_id AS history_flapping_host_id, history_flapping.service_id AS history_flapping_service_id, history_flapping.start_time AS history_flapping_start_time, history_flapping.end_time AS history_flapping_end_time, history_flapping.percent_state_change_start AS history_flapping_percent_state_change_start, history_flapping.percent_state_change_end AS history_flapping_percent_state_change_end, history_flapping.flapping_threshold_low AS history_flapping_flapping_threshold_low, history_flapping.flapping_threshold_high AS history_flapping_flapping_threshold_high, history_notification.id AS history_notification_id, history_notification.environment_id AS history_notification_environment_id, history_notification.endpoint_id AS history_notification_endpoint_id, history_notification.object_type AS history_notification_object_type, history_notification.host_id AS history_notification_host_id, history_notification.service_id AS history_notification_service_id, history_notification.notification_id AS history_notification_notification_id, history_notification.type AS history_notification_type, history_notification.send_time AS history_notification_send_time, history_notification.state AS history_notification_state, history_notification.previous_hard_state AS history_notification_previous_hard_state, history_notification.author AS history_notification_author, history_notification.text AS history_notification_text, history_notification.users_notified AS history_notification_users_notified, history_acknowledgement.id AS history_acknowledgement_id, history_acknowledgement.environment_id AS history_acknowledgement_environment_id, history_acknowledgement.endpoint_id AS history_acknowledgement_endpoint_id, history_acknowledgement.object_type AS history_acknowledgement_object_type, history_acknowledgement.host_id AS history_acknowledgement_host_id, history_acknowledgement.service_id AS history_acknowledgement_service_id, history_acknowledgement.set_time AS history_acknowledgement_set_time, history_acknowledgement.clear_time AS history_acknowledgement_clear_time, history_acknowledgement.author AS history_acknowledgement_author, history_acknowledgement.cleared_by AS history_acknowledgement_cleared_by, history_acknowledgement.comment AS history_acknowledgement_comment, history_acknowledgement.expire_time AS history_acknowledgement_expire_time, history_acknowledgement.is_sticky AS history_acknowledgement_is_sticky, history_acknowledgement.is_persistent AS history_acknowledgement_is_persistent, history_state.id AS history_state_id, history_state.environment_id AS history_state_environment_id, history_state.endpoint_id AS history_state_endpoint_id, history_state.object_type AS history_state_object_type, history_state.host_id AS history_state_host_id, history_state.service_id AS history_state_service_id, history_state.event_time AS history_state_event_time, history_state.state_type AS history_state_state_type, history_state.soft_state AS history_state_soft_state, history_state.hard_state AS history_state_hard_state, history_state.check_attempt AS history_state_check_attempt, history_state.previous_soft_state AS history_state_previous_soft_state, history_state.previous_hard_state AS history_state_previous_hard_state, history_state.output AS history_state_output, history_state.long_output AS history_state_long_output, history_state.max_check_attempts AS history_state_max_check_attempts, history_state.check_source AS history_state_check_source, history_state.scheduling_source AS history_state_scheduling_source FROM history LEFT JOIN host history_host ON history_host.id = history.host_id LEFT JOIN host_state history_host_state ON history_host_state.host_id = history_host.id LEFT JOIN service history_service ON history_service.id = history.service_id LEFT JOIN service_state history_service_state ON history_service_state.service_id = history_service.id LEFT JOIN comment_history history_comment ON history_comment.comment_id = history.comment_history_id LEFT JOIN downtime_history history_downtime ON history_downtime.downtime_id = history.downtime_history_id LEFT JOIN flapping_history history_flapping ON history_flapping.id = history.flapping_history_id LEFT JOIN notification_history history_notification ON history_notification.id = history.notification_history_id LEFT JOIN acknowledgement_history history_acknowledgement ON history_acknowledgement.id = history.acknowledgement_history_id LEFT JOIN state_history history_state ON history_state.id = history.state_history_id WHERE (history.event_time <= ?) AND ((history_host.id IS NOT NULL) OR (history_service.id IS NOT NULL)) ORDER BY history.event_time desc, history.event_type desc LIMIT 51
[1] => Array
(
[0] => 1081237488
)
)
```
## Expected behavior
The query builder should perform well on 32 bit.
## Your Environment
Include as many relevant details about the environment you experienced the problem in.
* Icinga DB Web version (System - About): 1.1.1
* Icinga Web 2 version (System - About): 2.12.1
* Web browser: CHrome
* Icinga 2 version (`icinga2 --version`): 2.14.2
* Icinga DB version (`icingadb --version`): 1.1.1
* PHP version used (`php --version`): 7.4
* Server operating system and version: Raspberry OS Bullseye 32bit