The clock type represent clock ticks counts and can be used for arithmetical operations.
The clock type clock_t is returned by the clock function of time.h header file.
It represents the number of clock ticks since the program was started.
Posted in C Reference time.h Functions |
Usage of strftime():
size_t strftime ( char * ptr_dest, size_t maxsize, const char * format, const struct tm * ptr_time );
Parameters:
ptr_dest is a pointer to the destination array where the resulting C string is copied too.
The maxsize contains the maximum number of characters to be copied to ptr_dest. More »
Posted in C Reference time.h Functions |
Usage of localtime():
struct tm * localtime ( const time_t * ptr_time );
Parameters:
The pointer ptr_time is a pointer to a time_t object that contains a calendar time.
Return Value:
The function localtime() returns a pointer to a tm structure. The tm structure contains the time information.
Explanation:
More »
Posted in C Reference time.h Functions |
Usage of gmtime():
struct tm * gmtime ( const time_t * ptr_time);
Parameters:
The pointer ptr_time is a pointer to a time_t object that contains a calendar time.
Calendar time is the number of seconds that have elapsed since EPOCH, which is 00:00:00, January 1, 1970 Universal Coordinate Time (UTC)
Return Value:
More »
Posted in C Reference time.h Functions |
Usage of ctime():
char * ctime ( const time_t * ptr_time );
Parameters:
Pointer ptr_time to a time_t object that contains a calendar time.
Return Value:
The function returns a C string containing the date and time information.
More »
Posted in C Reference time.h Functions |
Usage of asctime():
char * asctime ( const struct tm * ptr_time );
Parameters:
ptr_time is a pointer to a tm structure which in turn contains a calendar time.
Return Value:
The function returns a C string containing the date and time information.
The string is followed by a new-line character (‘\n’) and the terminating null-character. More »
Posted in C Reference time.h Functions |