LocalTime (get local current time and date)
"Header file" #include <time.h>
"Function prototype" struct TM *localtime (const time_t * TIMEP);
The function Description localtime () Converts the information in the time_t structure referred to by the parameter TIMEP to the time date representation used by the real world, and then returns the result from the Fabric TM. Please refer to Gmtime () for the definition of structure TM. The time date returned by this function has been converted to the local time zone.
Return value returns the Structure TM represents the current local time
The "Supplemental Instructions" function return value is a pointer, the actual memory is localtime internal static memory through static request, so through the localtime call after the return value is not used in a timely manner, it is likely to be overwritten by other threads localtime call. Other time functions, such as Asctime,asctime_r;ctime,ctime_r;gmtime,gmtime_r, are similar, so the _r version of the time function is thread-safe.
Mktime (Converts the time structure data to elapsed seconds)
"Header file" #include <time.h>
"Function prototype" time_t mktime (Strcut TM * timeptr);
The function Description Mktime () is used to convert the TM structure data referred to by the parameter timeptr to the number of seconds elapsed since January 1, 1970 0:0 0 seconds from the UTC time.
"Return value" returns the number of seconds elapsed
Difftime (two system time difference)
"Header file" #include <time.h>
"Function prototype" double Difftime (time_t timer1, time_t Timer0);
"Function description" calculates the time difference between two moments
"Return value" returns the time interval between two variables of type time_t
The time function of C library function