You are here

gettime c

gettime in c: gettime function is used to find current system time. We pass address of a structure varibale of type ( struct time ).

C programming code for gettime

  1. #include<stdio.h>
  2. #include<dos.h>
  3.  
  4. main()
  5. {
  6.    struct time t;
  7.  
  8.    gettime(&t);
  9.  
  10.    printf("Current system time is %d : %d : %d\n",t.ti_hour,t.ti_min,t.ti_sec);
  11.  
  12.    return 0;
  13. }