请问怎么取系统时间 我建了一个 控键变量 m_t 想让他显示系统时间怎么 取 (是否要转换日期型为字符串) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CTime time = CTime::GetCurrentTime();CString stime = time.Format("%a, %d %b %Y %H:%M:%S %z"); // 得到日期如20030322 14:12:34CString CNDSTimer::getTimeInYear(){ char szYear[5]; char szMonth[3]; char szDay[3]; char szHour[3]; char szMinute[3]; char szSecond[3]; char szValue[30]; SYSTEMTIME time; ::GetLocalTime(&time); itoa(time.wYear,szYear,10); ::strcpy(szValue,szYear); itoa(time.wMonth,szMonth,10); if (time.wMonth<10) ::strcat(szValue,"0"); strcat(szValue,szMonth); itoa(time.wDay,szDay,10); if (time.wDay <10) ::strcat(szValue,"0"); strcat(szValue,szDay); itoa(time.wHour,szHour,10); if (time.wHour <10) ::strcat(szValue,"0"); strcat(szValue," "); strcat(szValue,szHour); itoa(time.wMinute,szMinute,10); strcat(szValue,":"); if (time.wMinute <10) ::strcat(szValue,"0"); strcat(szValue,szMinute); itoa(time.wSecond,szSecond,10); strcat(szValue,":"); if (time.wSecond <10) ::strcat(szValue,"0"); strcat(szValue,szSecond); return CString(szValue);} COleDateTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S"); 同意skyzxg(sky) 的方法,最简单、直接。 哪位朋友有看雪的账号,麻烦给下个文件。非常感谢! vc中有没有既可以选择文件夹目录又可以选择文件的函数 用MPEG4 压缩bmp图片 再解压缩. 我是想把屏幕拍照下来在网上传给别人希望高手指点一下 求一些资料,希望大家帮帮我 请各位高手帮忙修改这两段代码,每段五十分。[急][紧急]下午得交程序了:(。 请问如何控制游戏的流程 各位好,请帮小弟解决这个问题 ASP调节器用COM开发DLL怎么让这个DLL发布到WEB客户端呀? 在线等待, 如何隐藏菜单下的某一项 求助listbox添加数据的问题 如何向数据库中写大块二进制数据? 命令行程序
CString stime = time.Format("%a, %d %b %Y %H:%M:%S %z");
CString CNDSTimer::getTimeInYear()
{
char szYear[5];
char szMonth[3];
char szDay[3];
char szHour[3];
char szMinute[3];
char szSecond[3];
char szValue[30]; SYSTEMTIME time;
::GetLocalTime(&time);
itoa(time.wYear,szYear,10);
::strcpy(szValue,szYear); itoa(time.wMonth,szMonth,10);
if (time.wMonth<10)
::strcat(szValue,"0");
strcat(szValue,szMonth);
itoa(time.wDay,szDay,10);
if (time.wDay <10)
::strcat(szValue,"0");
strcat(szValue,szDay); itoa(time.wHour,szHour,10);
if (time.wHour <10)
::strcat(szValue,"0");
strcat(szValue," ");
strcat(szValue,szHour); itoa(time.wMinute,szMinute,10);
strcat(szValue,":");
if (time.wMinute <10)
::strcat(szValue,"0");
strcat(szValue,szMinute); itoa(time.wSecond,szSecond,10);
strcat(szValue,":");
if (time.wSecond <10)
::strcat(szValue,"0");
strcat(szValue,szSecond); return CString(szValue);
}