1、

1 CString m_time;
2 CTime theCurrentTime = CTime::GetCurrentTime();
3 m_time = theCurrentTime.Format("%Y-%m-%d");



2、

1     struct tm *t;
2 time_t tt;
3 time(&tt);
4 t=localtime(&tt);
5 printf("%d-%d-%d\n",t->tm_year+1900,t->tm_mon+1,t->tm_mday);

 author:good90

参考:http://blog.sina.com.cn/s/blog_622bd1660100n53r.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-02-07
  • 2021-05-25
  • 2021-05-27
  • 2022-12-23
猜你喜欢
  • 2021-09-28
  • 2021-12-17
  • 2021-05-06
  • 2022-02-10
  • 2022-12-23
相关资源
相似解决方案