📅  最后修改于: 2022-03-11 14:58:01.279000             🧑  作者: Mango
#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();
}