fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. time_t rawtime;
  6. struct tm* ptm;
  7. time(&rawtime);
  8. ptm = gmtime(&rawtime);
  9.  
  10.  
  11. std::cout << ptm->tm_hour << std::endl ; // outputs "3" when it should be "9"
  12. return 0;
  13. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
9