#include <iostream>
      #include <ctime>
      
      time_t t = time(NULL);
      tm* timePtr = localtime(&t);
      cout << "month of year = " << (timePtr->tm_mon)+1 << endl;
      
      Cpp language logo

      Get month of year

      Codiga's C++ Recipes

      Display the current month of the year

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.