Hi Claudio,
Indeed you are thinking in the right direction!
formatDateTime($DateTime, 'HH') -> Extracts the hour part from the DateTime variable as a string in 24-hour format.
Use the parseInteger function to convert this string to an integer.
Hope this helps!