fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <chrono>
  4.  
  5. using namespace std;
  6.  
  7. string current_time()
  8. {
  9. std::time_t tt = chrono::system_clock::to_time_t(chrono::system_clock::now());
  10. return ctime(&tt);
  11. }
  12.  
  13. int main ()
  14. {
  15. std::cout << "now: " << current_time();
  16. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
now: Tue Apr  5 03:18:06 2016