?C???,time()???????(1970?1?1? 00:00:00 UTC)????????localtime()??????????????,???????tm??????,????????????????????????
?????????time()???localtime()??????:
#include#include int main() { time_t t = time(NULL); // ????????? struct tm* localT = localtime(&t); // ?????????? printf("????:%d-d-d d:d:d\n", localT->tm_year + 1900, localT->tm_mon + 1, localT->tm_mday, localT->tm_hour, localT->tm_min, localT->tm_sec); return 0; }
???????,????time()???????????,????localtime()???????????,???????tm???????,????tm??????,????????????????????,?????????