fork download
  1. #include <ctime>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. time_t now = time(0);
  9. tm *nowTm = gmtime(&now);
  10.  
  11. cout << nowTm->tm_year << "/" << nowTm->tm_mon << "/" << nowTm->tm_mday;
  12. cout << endl;
  13. cout << nowTm->tm_year + 1900 << "/" << nowTm->tm_mon + 1 << "/" << nowTm->tm_mday;
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
115/5/13
2015/6/13