fork(1) download
  1. #include <stdio.h>
  2. #include <time.h>
  3.  
  4. int main(void) {
  5. char buf[256];
  6.  
  7. time_t t1 = 61;
  8. struct tm *t2 = localtime(&t1);
  9.  
  10. strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", t2);
  11. printf("Time is: %s\n", buf);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 2424KB
stdin
Standard input is empty
stdout
Time is: 1970-01-01 00:01:01