QDateTime time = QDateTime::currentDateTime();
QString strTime = QString("%1%2%3")
.arg(time.date().year(), 4, 10, QChar('0'))
.arg(time.date().month(), 2, 10, QChar('0'))
.arg(time.date().day(), 2, 10, QChar('0'));那么strTime的输出为:20140905