#include #include #include //for class system_clock #include //for the functions time and localtime using namespace std; int main() { const auto now {chrono::system_clock::now()}; const time_t t {chrono::system_clock::to_time_t(now)}; const tm *const p {localtime(&t)}; //Get the current month of the year (0 to 11 inclusive). const int month {p->tm_mon}; switch (month) { case 0: cout << "January"; break; case 1: cout << "February"; break; case 2: cout << "March"; break; case 3: cout << "April"; break; case 4: cout << "May"; break; case 5: cout << "June"; break; case 6: cout << "July"; break; case 7: cout << " August"; break; case 8: cout << "September"; break; case 9: cout << "October"; break; case 10: cout << "November"; break; case 11: cout << "December"; break; default: cerr << "Bad month " << month << " should have been in range 0 to 11 inclusive.\n"; return EXIT_FAILURE; } cout << "\n"; return EXIT_SUCCESS; }