CSDN博客

img zzz_781111

Get the data of today only use c language

发表于2008/10/1 21:35:00  473人阅读

分类: c++

#include <time.h>
void CTestDlg::OnOK()
{
time_t rawtime;
struct tm * timeinfo;  
time ( &rawtime );
timeinfo = localtime ( &rawtime );
char nowtime[200];
sprintf (nowtime, "%4d_%02d_%02d",1900+timeinfo->tm_year, 1+timeinfo->tm_mon,
timeinfo->tm_mday );

MessageBox (  nowtime );
    
//    CDialog::OnOK();
}
阅读全文
0 0

相关文章推荐

img
取 消
img