Include File: # ifndef _ TIME_T # define _ TIME_T/* avoid repeatedly defining time_t */typedef long time_t; /* The Time Value time_t is the alias of a long integer */# endif since time_t is actually a long integer, to a certain day in the future, from a time point (usually January 1, 1970 00:00:00) by that time, the number of seconds (that is, the calendar time) exceeds the range of the number that can be expressed by a long integer. What should I do? For a value of the time_t data type, the time it represents cannot be later than January 18, 2038. To represent a longer period of time, some compiler vendors have introduced 64-bit or even longer integer numbers to save the calendar time. For example, Microsoft uses the _ time64_t data type in Visual C ++ to save the calendar time, and uses _ time64 () function to obtain the calendar time (instead of using the 32-bit time () function), you can use this data type to save the time before 00:00:00, January 1, January 1, 3001 (excluding this time point. In time. in the h header file, we can also see some functions that are of the time_t parameter type or return value type: double difftime (time_t time1, time_t time0 ); time_t mktime (struct tm * timeptr); time_t time (time_t * timer); char * asctime (const struct tm * timeptr); char * ctime (const time_t * timer, time. h also provides two different functions to convert the calendar time (an integer expressed in time_t) to the time format that we usually see separately displaying year, month, day, hour, minute, and second. tm: www.2cto. comstruct tm * gmtime (const time_t * timer); struct tm * localtime (const time_t * timer ); Www.2cto.com by referring to MSDN, we can know that the value of the time point in Microsoft C/C ++ 7.0 (the value of the time_t object) is the number of seconds passed from 00:00:00 on January 1, December 31, 1899 to this time point, microsoft C/C ++ of other versions and Visual C ++ of all different versions calculate the number of seconds that have elapsed since 00:00:00, January 1, January 1, 1970 to this time point. Time_t occupies 8 digits: there is a picture with truth