gettime() Function in C

gettime() Function in C
Returns System Time.



#include
#include

main()
{
struct time t;

gettime(&t);

printf("Current system time is %d : %d : %d\n",t.ti_hour,t.ti_min,t.ti_sec);

return 0;
}



1 comment:

  1. there is a problem with this program , if you change the system time and run the program again w/o restarting then the output is still the old system time

    ReplyDelete