fork(2) download
  1. #include <iostream>
  2. #include <ctime>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. time_t now = time(0);
  8. tm *ltm = localtime(&now);
  9. cout << "Year: "<< 1900 + ltm->tm_year << endl;
  10. cout << "Month: "<< 1 + ltm->tm_mon<< endl;
  11. cout << "Day: "<< ltm->tm_mday << endl;
  12. }
  13.  
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
Year: 2015
Month: 4
Day: 14