C library function of time.h header file

time.h header file contains all the library function related to time in C. In this guide we will see all the function under time.h and their use. Let’s see all the library function of time.h bellow;

  • clock() — clock() function is used to get current time of the system.
  • time() — time() function is also used to get current system time. But we will get time as structure when we use time() library function.
  • setdate() — setdated() function can set the system date as per our requirement.
  • getdate() — getdate() is used to get the time of our system.
  • asctime() — asctime() function returns the time with date.
  • ctime() — ctime() function is also used to get date and time as a string.
  • difftime() — difftime() function is used to determine the difference between two given time.
  • gmtime() — gmtime() function gives the UTC time and date.
  • mktime() — mktime() library function gives the calendar time equivalent using data type time_t.
  • starftime() — We can format the string returns by other time function using starftime() function by various format specifiers.
  • localtime() — localtime() function gives us local date and time information.

Previous pagectype.h header file

Next pagefloat.h header file