I need to find a time X hours before the previous midnight, thus I would like to subtract X hours from a date object.
Example
# Finding the previous midnight
date -d "yesterday 23:59:59"
Mon Jul 11 00:00:00 CEST 2022
What I want I would like to find the date X hours before this midnight
x=4
Mon Jul 10 20:00:00 CEST 2022