I’ve calculated the day, day of month and year, and seconds, minutes, and hours using std::chrono::local_days, I just now need to get the day of the week. The code I’m using was given by Howard Hinnant on an answer here, comments are mine:
auto tp = std::chrono::system_clock::now();
static auto const tz = std::chrono::current_zone();
static auto info = tz->get_info(tp); // CACHE THE TIMEZONE INFO
if (tp >= info.end) // APPARENTLY THE TIME ZONE INFO CAN CHANGE UP TO TWICE A YEAR
info = tz->get_info(tp);
auto tpl = std::chrono::local_days{} + (tp + info.offset - std::chrono::sys_days{});
auto tpd = floor<std::chrono::days>(tpl);
std::chrono::year_month_day ymd{ tpd };
std::chrono::hh_mm_ss hms{ tpl - tpd };
At this point I have the what I mentioned above, how can I get the day of the week with as few redundant calls as possible?