1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

Fix warning if put_time is not present

This commit is contained in:
Carles Fernandez 2019-03-19 21:11:21 +01:00
parent 10d73da839
commit 994f192636
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -366,10 +366,10 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
// Display time in local time zone
d_show_local_time_zone = conf_.show_local_time_zone;
time_t when = std::time(nullptr);
auto const tm = *std::localtime(&when);
std::ostringstream os;
#ifdef HAS_PUT_TIME
time_t when = std::time(nullptr);
auto const tm = *std::localtime(&when);
os << std::put_time(&tm, "%z");
#endif
std::string utc_diff_str = os.str(); // in ISO 8601 format: "+HHMM" or "-HHMM"