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

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