64,646
社区成员
发帖
与我相关
我的任务
分享
CTime t1(2012, 1, 19, 23, 45, 10); // 10:15 PM March 19, 1999
CTime t2(2013, 3, 20, 22, 15, 0); // 10:15 PM March 20, 1999
CTimeSpan ts = t2 - t1; // Subtract 2 CTimes
cout << "时间相差 "<<ts.GetDays() <<"天 " << ts.GetHours() << "时 " << ts.GetMinutes() << "分 "<< ts.GetSeconds()<<"秒 " << endl;
[/quote] CTime t1(2012, 1, 19, 23, 45, 10); // 10:15 PM March 19, 1999
CTime t2(2013, 3, 20, 22, 15, 0); // 10:15 PM March 20, 1999
CTimeSpan ts = t2 - t1; // Subtract 2 CTimes
cout << "时间相差 "<<ts.GetDays() <<"天 " << ts.GetHours() << "时 " << ts.GetMinutes() << "分 "<< ts.GetSeconds()<<"秒 " << endl;