Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to convert the values of year, month, day, hour, minute and second into seconds in C language and store them in unsigned int type?
How to convert the values of year, month, day, hour, minute and second into seconds in C language and store them in unsigned int type?
Time_t is actually a long integer. You can import the time.h header file for direct use, and there are a bunch of functions that can be used, and you don't need to do the conversion yourself.

The time function is 1970 65438+ 10 65438+ the number of seconds from 0: 00: 00 to this moment (that is, the calendar time). For the value of time_t data type, it represents the time of 65438+ 10/0/819: 00.