fork download
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. #include <stdio.h>
  14. #include <time.h>
  15.  
  16. int main() {
  17. setenv("TZ", "Asia/Shanghai", 1);
  18. tzset();
  19. time_t t = time(NULL);
  20. struct tm *current_time = localtime(&t);
  21. int frame = (current_time->tm_hour * 3600 + current_time->tm_min * 60 + current_time->tm_sec) * 24;
  22. printf("时间: %04d-%02d-%02d %02d:%02d:%02d\n帧数: %d\n试一试下一秒!🦁\n",
  23. current_time->tm_year + 1900, current_time->tm_mon + 1, current_time->tm_mday,
  24. current_time->tm_hour, current_time->tm_min, current_time->tm_sec, frame);
  25. return 0;
  26. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
时间: 2025-02-19 16:20:14
帧数: 1411536
试一试下一秒!🦁