Posted to tcl by kbk at Thu Jul 24 01:40:16 GMT 2008view raw

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. int
  5. main(int argc, char* argv[])
  6. {
  7. char s[100];
  8. const time_t tick = 1136073600;
  9. struct tm* tock = gmtime(&tick);
  10. printf("isdst %d yday %d wday %d year %d month %d mday %d "
  11. "hour %d min %d sec %d\n",
  12. tock->tm_isdst, tock->tm_yday+1, tock->tm_wday,
  13. tock->tm_year+1900, tock->tm_mon+1,
  14. tock->tm_mday, tock->tm_hour, tock->tm_min, tock->tm_sec);
  15. strftime(s, 100, "%a %A %g %G %u %V %w", tock);
  16. printf("%s\n", s);
  17. return 0;
  18. }