79192099

Date: 2024-11-15 11:11:43
Score: 1
Natty:
Report link

You can convert the sys_time to local_time with std::chrono::current_zone()->to_local(now). Then you can convert the local_time to year_month_day.

const std::chrono::sys_days now = std::chrono::system_clock::now();
const std::chrono::local_days local_now = std::chrono::current_zone()->to_local(now);
const std::chrono::year_month_day ymd{ local_now };
Reasons:
  • Blacklisted phrase (1): days now
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: cpplearner