CDateTimeCtrl同时显示日期和时间

来源:互联网 发布:iapp源码大师 编辑:程序博客网 时间:2024/06/06 04:03

这个问题引起的一个BUG, 记下来, 在对话框显示后,界面上的CDateTimeCtrl时间不再进行改变,如果需要修改,需自己进行

    SYSTEMTIME st;
    GetSystemTime(&st);
    SystemTimeToTzSpecificLocalTime(NULL, &st, &st);  //时间转换
    m_picker.SetTime(&st);

 


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"). 

原创粉丝点击