📌  相关文章
📜  qdate 两个日期之间的差异 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:01.279000             🧑  作者: Mango

代码示例1
#include 
#include 
#include 

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    // get current date
    QDate dNow(QDate::currentDate());
    // create other date
    //  by giving date 12.21.2012 (joke about end of the world)
    QDate dEndOfTheWorld(2012, 12, 21);
    qDebug() << "Today is" << dNow.toString("dd.MM.yyyy")
             << "Days to end of the world: "
             << dNow.daysTo(dEndOfTheWorld);

    return a.exec();
}