Is there a modern and elegant way to determine if the month and day in a time_point variable match a given month_day variable?
For example, I want to know if today is Christmas. I have the following code:
#include <chrono>
bool IsTodayChristmas()
{
using namespace std::chrono;
constexpr month_day Christmas = {December / 25};
auto Now = system_clock::now();
// return Now == Christmas; // How to?
}
Modern and elegant: I mean if possible, I would prefer not to use old C types (something like std::time_t and std::tm) and string comparisons (something like std::put_time).
Any help would be appreciated.