共用方式為


Formatting Time: Automation Classes

格式化時間

  • 使用 COleDateTimeCOleDateTimeSpan 建立表示時間的字串或已耗用時間的 格式 成員函式。

    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