Formatting Time: Automation Classes

设置时间

  • 使用 COleDateTimeCOleDateTimeSpan 创建表示时间的字符串)或经过的时间 Format 成员函数。

    COleDateTime time(1970, 12, 18, 17, 30, 0);
    // 18 December 1970, 5:30 PM
    CString s = time.Format(VAR_DATEVALUEONLY);
    // s contains the date formatted based on  
    // the current national language specifications 
    // (locale ID). The time portion is ignored for  
    // formatting purposes in this case.   
    

有关更多信息,请参见选件类 COleVariant

您想进一步了解什么?

请参见

概念

Date and Time: Automation Support