如何让CDateTimeCtrl同时显示日期和时间呢? 问题点数:20、回复次数:13Top
我一般用两个并排.
否则就要动用activeX控件了Top
好象是设置 format string,用自定义格式Top
format 显示出来后日期不对啊Top
且两个吧,没必要为这花时间Top
CDateTimeCtrl::SetFormat ("yyyy-MM-dd HH:mm:ss")Top
这个方法试过了,不行啊Top
"%Y%m%d %H%M%S"Top
CDataTimeCtrl::SetFormat("yyyy-M-d HH-mm-ss");
"d" The one- or two-digit day.
"dd" The two-digit day. Single-digit day values are preceded by a zero.
"ddd" The three-character weekday abbreviation.
"dddd" The full weekday name.
"h" The one- or two-digit hour in 12-hour format.
"hh" The two-digit hour in 12-hour format. Single-digit values are preceded by a zero.
"H" The one- or two-digit hour in 24-hour format.
"HH" The two-digit hour in 24-hour format. Single-digit values are preceded by a zero.
"m" The one- or two-digit minute.
"mm" The two-digit minute. Single-digit values are preceded by a zero.
"M" The one- or two-digit month number.
"MM" The two-digit month number. Single-digit values are preceded by a zero.
"MMM" The three-character month abbreviation.
"MMMM" The full month name.
"t" The one-letter AM/PM abbreviation (that is, AM is displayed as "A").
"tt" The two-letter AM/PM abbreviation (that is, AM is displayed as "AM").
"yy" The last two digits of the year (that is, 1996 would be displayed as "96").
"yyyy" The full year (that is, 1996 would be displayed as "1996").
Top
如果控件的变量(控制类)为 m_dt
则
m_dt.SetFormat("yyyy-M-d HH:mm:ss");Top
强烈推荐 neosu(neo)的方法!
Top
显示出来月份不正确,居然出现59Top
显示出来月份不正确,居然出现59
===
给出你的SetFormat代码Top
显示出来月份不正确,居然出现59
======
肯定是显示成分钟了。月份是大写的M