c++获取日期

示例

#include 
#include 

int main()
{
  time_t now = time(nullptr);
  tm     *t  = localtime(&now);
  
  std::cout << "date:" << (t->tm_year + 1900) << "-" << (t->tm_mon + 1) << "-" <<  t->tm_mday << std::endl;
}

你可能感兴趣的:(c++,c++,开发语言)