fork(65) download
  1. #include <iostream>
  2. #include <ctime>
  3. #include <string>
  4.  
  5.  
  6. std::string now()
  7. {
  8. std::time_t now= std::time(0);
  9. std::tm* now_tm= std::gmtime(&now);
  10. char buf[42];
  11. std::strftime(buf, 42, "%Y%m%d %X", now_tm);
  12. return buf;
  13. }
  14.  
  15. int main(){ std::cout<< now()<< '\n'; }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
20131220 19:33:51