Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between clock_t, time_t and struct tm?

Tags:

People also ask

What is time_t structure?

Data Type: time_t. time_t is the simplest data type used to represent simple calendar time. In ISO C, time_t can be either an integer or a floating-point type, and the meaning of time_t values is not specified.

What is time_ t type?

The time_t datatype is a data type in the ISO C library defined for storing system time values. Such values are returned from the standard time() library function. This type is a typedef defined in the standard <time.


What is the difference between clock_t, time_t and struct tm?

struct tm looks like this:

struct tm{ int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; 

But how does clock_t and time_t look like?