As I have mentioned in title if I use date('H') function in WP theme, it simply returns UTC time, but the server is set to use timezone Europe/Riga and the same is set in WP General settings. At the same time if I use the same function in empty PHP test file it returns correctly as needed UTC+3. How can it be?
OK, I found the answer myself. Turns out that in Wordpress the UTC time is hardcoded and thus using PHP's date() will always return UTC. Instead you should use WP's function current_time(). Here are more details