Below is the SOQL to query data which was modified between 8 PM and 10 PM.
Sample SOQL:
SELECT Id, LastModifiedDate FROM Contact WHERE LastModifiedDate = TODAY AND HOUR_IN_DAY(LastModifiedDate) >= 20 AND HOUR_IN_DAY(LastModifiedDate) < 22
Below is the SOQL to query data which was modified between 8 PM and 10 PM.
Sample SOQL:
SELECT Id, LastModifiedDate FROM Contact WHERE LastModifiedDate = TODAY AND HOUR_IN_DAY(LastModifiedDate) >= 20 AND HOUR_IN_DAY(LastModifiedDate) < 22