Do a simple subtraction such as (local_time - UTC_time) and u’ll get the exact offset from UTC, meaning your local timezone. I needed the same thing and realized how to do it just now in BP, but it’ll work the same in C++.
If you are looking for UTC offset, then Pixel’s Laboratory’s suggestion works well I think!
However if you are looking to see if the current time zone is on daylight saving time at the time of execution, and if you don’t mind using c++20 in your project (and using some std::strings), perhaps you may have some luck with the sys_info struct from the chrono library.
The following prints out “60min” on my system
#include <chrono>
#include <iostream>
using namespace std::chrono;
int main()
{
sys_time<system_clock::duration> st = system_clock::now();
const auto& timeZoneDatabase = get_tzdb();
const auto& currentZone = timeZoneDatabase.current_zone();
auto sysInfo = currentZone->get_info(st);
std::cout << sysInfo.save;
return 0;
}
Note that it returns an std::string. Example taken from here.