Monday, October 31, 2016

C Library Function – time

The <time.h> header shall define the following function(s).

Time manipulation Functions:
difftime double difftime( time_t time_end, time_t time_beg );
time time_t time( time_t *arg );
clock clock_t clock(void);
timespec_get(C11) int timespec_get( struct timespec *ts, int base);
mktime time_t mktime( struct tm *time );

Time conversion Functions:
asctime char* asctime( const struct tm* time_ptr );
asctime_s(C11) errno_t asctime_s(char *buf, rsize_t bufsz, const struct tm *time_ptr);
ctime char* ctime( const time_t* time );
ctime_s(C11) errno_t ctime_s(char *buffer, rsize_t bufsz, const time_t *time);
strftime size_t strftime( char * str, size_t count, const char * format, const struct tm * time );
gmtime struct tm *gmtime( const time_t *time );
gmtime_s(C11) struct tm *gmtime_s(const time_t *restrict time, struct tm *restrict result);
localtime struct tm *localtime( const time_t *time );
localtime_s(C11) struct tm *localtime_s(const time_t *restrict time, struct tm *restrict result);

Related topics:
Library Functions in C   |   Standard Library in C   |   Header Files in C   |   Functions in C   |   Keywords in C   |   Data Types in C   |   Pointers in C

List of topics: C Programming

No comments:

Post a Comment