运行 ❯
获取您
自己的
网站
×
更改方向
更改主题,浅色/深色
进入 Spaces
#include <iostream> #include <ctime> // Import the ctime library using namespace std; int main () { time_t timestamp = time(×tamp); struct tm datetime = *localtime(×tamp); cout << datetime.tm_hour; return 0; } // Note: This example displays the server's local time, which may differ from your local time.