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!
Mendix people, who are you, which background do you have?
You ask developers do format datetime to string and then parse string to int to get Hours, year, etc. Are you serious?