Getting current timezone
Headers
You're missing #include &lt;ctime&gt;.
Naming
Identifiers beginning with underscore are reserved for the implementation, so _tzset() is a risky choice, and may result in undefined behaviour.
Interface
What does the return value mean?  Although declared to return bool, it never returns a false value, so it's unclear how the result is intended to be used.  void may be a better choice, but I think it's more reasonable to return an arithmetic result (and thus eliminate the use of the global timezone).
It is likely that we might want to find this information for an arbitrary time value, rather than only for &quot;now&quot;, so I suggest adding a defaulted parameter to pass in the time to be considered.
Assumptions about std::time_t
This code assumes that time_t is a signed type; if it's unsigned, then the subtraction gmt - local may overflow.  It also assumes that time_t counts in units of seconds; that is not required by the C++ standard (though it is a common implementation choice, and is perhaps required for POSIX compliance).  Instead of using arithmetic subtraction, it is portable to use std::difftime() - it is safe if time_t is unsigned, and it is defined to return its results in seconds.
Assumptions about std::mktime()
This code assumes that std::mktime() ignores the tm_isdst field of std::tm.  In my experience, implementations do not ignore it, meaning that local and gmt values are always equal in time zones such as Europe/London.
Failure around DST transitions
Even if corrected to account for tm_isdst, I'm finding it hard to reason whether the code is correct shortly before (or shortly after) a daylight-savings transition (in either direction).  I'd expect to see four unit-tests (in a specific timezone) that verify the behaviour, but there are no tests provided at all.
Alternative approach
Instead of (ab)using std::mktime() in this way, it's far safer and more transparent to use std::time_put() with a format string of %z to obtain the offset from UTC in ISO-8601 format (±HHMM) and convert that string into seconds (taking care to apply the sign to both the hours and the minutes):
#include &lt;ctime&gt;
#include &lt;iomanip&gt;
#include &lt;sstream&gt;

static constexpr time_t const NULL_TIME = -1;

// returns difference in seconds from UTC at given time
// or at current time if not specified
long tz_offset(time_t when = NULL_TIME)
{
    if (when == NULL_TIME)
        when = std::time(nullptr);
    auto const tm = *std::localtime(&amp;when);
    std::ostringstream os;
    os &lt;&lt; std::put_time(&amp;tm, &quot;%z&quot;);
    std::string s = os.str();
    // s is in ISO 8601 format: &quot;±HHMM&quot;
    int h = std::stoi(s.substr(0,3), nullptr, 10);
    int m = std::stoi(s[0]+s.substr(3), nullptr, 10);

    return h * 3600 + m * 60;
}

#include &lt;iostream&gt;
int main()
{
    std::cout &lt;&lt; tz_offset() &lt;&lt; std::endl;
}