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