CString szTime;
我已经得到szTime="12:31:35",我如何把当天的日期加上去,得到szTime="2005-11-30 12:31:35"
---------------------------------------------------------------
GetCurrentTime() 可以获取PC当前的年月日时分秒的。
查查相关资料吧。
---------------------------------------------------------------
CTime m_Time=CTime::GetCurrentTime();
CString str;
CString szTime="12:31:35",
str.Format("%d-%d-%d %s",m_Time.GetYear(),m_Time.GetMonth(),m_Time.GetDay(),szTime);
我已经得到szTime="12:31:35",我如何把当天的日期加上去,得到szTime="2005-11-30 12:31:35"
---------------------------------------------------------------
GetCurrentTime() 可以获取PC当前的年月日时分秒的。
查查相关资料吧。
---------------------------------------------------------------
CTime m_Time=CTime::GetCurrentTime();
CString str;
CString szTime="12:31:35",
str.Format("%d-%d-%d %s",m_Time.GetYear(),m_Time.GetMonth(),m_Time.GetDay(),szTime);
博客围绕CString添加当天日期展开,提问者已得到szTime为时间格式,想将当天日期加上。给出的解决办法是使用GetCurrentTime()获取PC当前的年月日时分秒,通过CTime和CString,用Format函数实现日期和时间的拼接。
323

被折叠的 条评论
为什么被折叠?



