fork download
  1. #include <time.h>
  2. #include <stdio.h>
  3.  
  4.  
  5. void put_date(void)
  6. {
  7. time_t current;
  8. struct tm *local;
  9. /*char wday_name[][3]
  10.   ={"日", "月", "火", "水", "木", "金", "土"};*/
  11.  
  12. time(&current);
  13. local = localtime(&current);
  14. printf("%02d時%02d分%02d秒",
  15. local->tm_hour,
  16. local->tm_min,
  17. local->tm_sec);
  18. }
  19. int main(void)
  20. {
  21. printf("今日は");
  22. put_date();
  23. printf("です。\n");
  24.  
  25. return (0);
  26. }
Success #stdin #stdout 0.01s 1852KB
stdin
Standard input is empty
stdout
今日は11時20分53秒です。