fork download
  1. #include <stdio.h>
  2. #include <time.h>
  3.  
  4. int main(void) {
  5. struct tm test_datetime = {
  6. .tm_mday = 1,
  7. .tm_wday = -1,
  8. .tm_mon = 2 - 1,
  9. .tm_year = 2020 - 1900,
  10. }; /* 0/2/2020 */
  11.  
  12. mktime(&test_datetime);
  13. puts(asctime(&test_datetime));
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
Sat Feb  1 00:00:00 2020