fork(1) download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <ctime>
  4. #include <chrono>
  5.  
  6. using std::chrono::system_clock;
  7.  
  8. int main()
  9. {
  10. system_clock::time_point now = system_clock::now();
  11. std::time_t now_c = system_clock::to_time_t(
  12. now - std::chrono::hours(24));
  13. std::cout << "One day ago, the time was "
  14. << std::put_time(std::localtime(&now_c), "%F %T") << '\n';
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:14:18: error: 'put_time' is not a member of 'std'
stdout
Standard output is empty