64,639
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
time_t t = time(NULL);
struct tm * p1 = gmtime(&t);
struct tm * p2 = localtime(&t);
cout<<p1->tm_hour<<endl;
cout<<p2->tm_hour<<endl;
system("pause");
return 0;
}
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
time_t t = time(NULL);
struct tm * p1 = gmtime(&t);
cout<<p1->tm_hour<<endl;
struct tm * p2 = localtime(&t);
cout<<p2->tm_hour<<endl;
system("pause");
return 0;
}