there is a function called hour.
Maybe it will help you
for HOUR(TIMEVALUE("17:30:45.125")) returns 17.
HOUR(TIMEVALUE("17:30:45.125"))
https://help.salesforce.com/s/articleView?id=platform.customize_functions_hour.htm&type=5