About time.h
https://www.runoob.com/cprogramming/c-standard-library-time-h.html
#include <the iostream> #include <the ctime> the using namespace STD; int main () { struct (TM) T; // (TM) structured pointer char stTmp [ 32 ]; time_t now; // declare a variable of time_t now = time (NULL); // get the system date and time time (& now); localtime_s (& t, & now); // Gets the local date and time cout << t.tm_year + 1900 << " years " ; cout << t.tm_mon + 1 << " month " ; cost <<t.tm_mday<<"日 "; cout<<"周 "<<t.tm_wday<<" ";//为了输出好看。。 cout<<t.tm_hour<<"时 "; cout<<t.tm_min<<"分 "; cout<<t.tm_sec<<"秒"; return 0; }
// Compared with time_t, there is a clock_t, is used in recording on cpu time, to distinguish between the two.