/********************************************* Usage: Convert s.th. like 1005581964.748278 as obtained from the local clock (seconds and nanoseconds) into a human readable Mon Nov 12 17:19:24 2001 by the call tmspec2asc 1005581964.748278 for example. Compilation: make tmspec2asc Richard J. Mathar, 2001-11-14 *********************************************/ #include #include #include int main(int argc, char *argv[]) { #if 0 char *dot ; #endif time_t Sec ; struct tm * thistm ; if( argc != 2) { fprintf(stderr,"usage: %s sec.nanosec\n",argv[0]) ; return 1 ; } #if 0 /* dot=strchr(argv[1],'.') ; */ #endif Sec=atol(argv[1]) ; thistm= localtime(&Sec) ; printf("%s",asctime(thistm)) ; return 0 ; }