CSDN博客

img zzz_781111

Get the data of today only use c language

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

#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