fork(8) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <sys/time.h>
  4. #include <time.h>
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. char cBuffer[100];
  9. time_t zaman;
  10. struct tm *ltime;
  11. static struct timeval _t;
  12. static struct timezone tz;
  13.  
  14. time(&zaman);
  15. ltime = (struct tm *) localtime(&zaman);
  16. gettimeofday(&_t, &tz);
  17.  
  18. strftime(cBuffer,100,"%d.%m.%y %H:%M:%S",ltime);
  19. sprintf(cBuffer, "%s.%d", cBuffer,(int)_t.tv_usec);
  20.  
  21. printf(" %s \n",cBuffer);
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 2184KB
stdin
Standard input is empty
stdout
 17.07.15 12:11:18.803442