fork(1) download
  1. #include <ctime>
  2. #include <iostream>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. tm tmbuf;
  9. const char *str = "20:48:01.469 UTC MAR 31 2016";
  10. const char *fmt = "%H:%M:%s.%Y %Z %b %d %Y";
  11. strptime(str,fmt,&tmbuf);
  12.  
  13. cout << put_time(&tmbuf, "%m-%d-%Y") << endl;
  14. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
03-31-2016