... get local time in UTC is good question and good answer...
No, that is actually not a good question. "local time in UTC" is nonsensical. A time value can either be in UTC, or it can be local. They might be equivalent if your local time happens to be aligned to UTC+00:00, but they are generally considered two different things.
... I want to know UTC time.
All languages and platforms have APIs for retrieving the current UTC time. UTC is the same for everyone on the planet at all times. You do not need to make a call to an external API to determine this. All that matters is that your computer's clock is synchronized to an external time source.
... But UTC time can be know only by dstOffset and rawOffset. So, for obtain dstOffset and rawOffset is necessary know them before.
That is incorrect. You do not need to know anything about your local time zone to determine the current UTC time. All modern operating systems keep track of track time in UTC. They convert to local time when needed, such as to display the local clock to the end user.