运行 ❯
获得您
自己的
网站
×
更改方向
更改主题,暗/亮
前往 Spaces
#include <iostream> #include <ctime> using namespace std; int main() { struct tm date; time_t timestamp; date.tm_year = 2024 - 1900; // Number of years since 1900 date.tm_mon = 4 - 1; // Number of months since January date.tm_mday = 31; date.tm_hour = 0; date.tm_min = 0; date.tm_sec = 0; date.tm_isdst = -1; timestamp = mktime(&date); cout << ctime(×tamp); return 0; }
星期三 5 月 1 00:00:00 2024