📅  最后修改于: 2022-03-11 14:44:58.028000             🧑  作者: Mango
#include
#include
int main() {
std::time_t t = std::time(0); // get time now
std::tm* now = std::localtime(&t);
std::cout << (now->tm_year + 1900) << '-'
<< (now->tm_mon + 1) << '-'
<< now->tm_mday
<< "\n";
}