上面的小问题困惑好久了,谁帮忙解决一下,分不够的话我在追加

解决方案 »

  1.   

    Examplevoid CDatesDlg::OnButton2() 
    {
       // Gain a pointer to the control
       CDateTimeCtrl* pCtrl = (CDateTimeCtrl*) GetDlgItem(IDC_DATETIMEPICKER1);
       ASSERT(pCtrl != NULL);   // The control will create itself with a format that matches the 
       // locale setting in Control Panel. But we can force a particular 
       // format with a call to SetFormat(). This call forces the format 
       // dd-MMM-yy, which would show 03-APR-98 for April 3rd, 1998.   pCtrl->SetFormat(_T("dd-MMM-yy"));
    }Element Description  
    "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").