#include <iostream> #include <ctime> /* time.h in C */ using namespace std; int main() { time_t now; struct tm *fmt; time(&now); fmt = localtime(&now); cout << "Hours:\t\t" << fmt->tm_hour << endl; cout << "Minutes:\t" << fmt->tm_min << endl; cout << "Seconds:\t" << fmt->tm_sec << endl; return 0; }
C++获取当前时间int类型
最新推荐文章于 2022-08-29 21:06:01 发布