Table of Contents

gettime

struct time gettime( struct time );

description of gettime

gettime function is used to find current system time.
returns structure varibale of type ( struct time ).

#include<stdio.h>
#include<dos.h>
 
int main(void)
{
   struct time t;
   gettime(&t);
   printf("time is %d:%d:%d\n",t.ti_hour,t.ti_min,t.ti_sec);
   return 0;
}

output of gettime c example

  time is 12:30:42