#include <iostream>
#include <ctime>
time_t t = time(NULL);
tm* timePtr = localtime(&t);
cout << "year = " << (timePtr->tm_year)+1900 << endl;
Get current year
Display the current year
0 Comments
Add Comment
Log in to add a comment
#include <iostream>
#include <ctime>
time_t t = time(NULL);
tm* timePtr = localtime(&t);
cout << "year = " << (timePtr->tm_year)+1900 << endl;
Get current year
Display the current year
Log in to add a comment