获取当前日期

基本类型 / 日期和时间

#include <iostream>
using namespace std;

time_t now = time(0);

cout << "now is " << now;