各种时间格式化

    技术2022-05-20  31

     

    // CString str; 

    // SYSTEMTIME t; 

    // GetLocalTime(&t); 

    //str.Format("%Y-%m-%d %H:%M:%S:%?",t.wYear,t.wMonth,t.wDay,t.wHour,t.wMinute,t.wSecond,t.wMilliseconds);

    //CString strDate,strTime; 

    //CTime time; 

    //time = time.GetCurrentTime(); 

    //strDate = time.Format("%Y%m%d"); 

    //strTime = time.Format("%H:%M:%S");

    //"u:u:u u:u:u.u"

    //Time1 > CONVERT(datetime, '%s') AND time1 < CONVERT(datetime, '%s')

    //time < to_date('" + strEndTime + "','yyyy-mm-dd hh24:mi:ss')

    //CString   s("2001-8-29   19:06:23");   

    // int   nYear,   nMonth,   nDate,   nHour,   nMin,   nSec;   

    // sscanf(s,   "%d-%d-%d   %d:%d:%d",   &nYear,   &nMonth,   &nDate,   &nHour,   &nMin,   &nSec);   

    // CTime   t(nYear,   nMonth,   nDate,   nHour,   nMin,   nSec);

     

     

     

    COleDateTime t1(1999, 3, 20, 21, 15, 0);

    //t.ParseDateTime( str1 );

    COleDateTime t2(1999, 3, 20, 22, 15, 0);

    COleDateTimeSpan ts = t1 - t2;

    double val = ts.GetTotalSeconds();


    最新回复(0)