Is it true that it is not recommended to use cctz::lookup(..) and always preferred to use cctz::format(..) instead?
But if I want to store the results (year, month, day...offset, isDST, abbr) in integer, double, bool and string variables. How can I do this using cctz::format(..)?
Is there a way to do the following example with cctz::format(..)? If so can you please give a short example?
int main()
{
cctz::time_zone lax;
load_time_zone("America/Los_Angeles", &lax);
const auto tp = cctz::convert(cctz::civil_second(2015, 9, 22, 9, 0, 0), lax);
cctz::time_zone nyc;
load_time_zone("America/New_York", &nyc);
const auto al = nyc.lookup(tp);
int year, month, day, hour, minute, second;
double UT_Offset;
bool isDST;
std::string abbr;
year = al.cs.year();
month = al.cs.month();
day = al.cs.day();
hour = al.cs.hour();
minute = al.cs.minute();
second = al.cs.second();
UT_Offset = al.offset / 3600.0;
isDST = al.is_dst;
abbr = al.abbr;
}