场景说明
#include<QDateTime>
QDateTime  datetime = QDateTime::currentDateTime();
QString  str = datetime.toString("Date:yyyy-MM-ddThh:mm:ss.zzz");
qDebug()<<str<<endl;

问题
    无法输出Date,后面的时间是正确的!

解决方案
    原来,”Date”的时候,字母a,会被认为是其中的格式化变量值,查看相关的输出参数列表发现,字母a是有特殊含义的:ap  use am/pm display.apwill be replaced by either "am" or "pm
也就是标志上下午的意思,所以通过测试,使用下面的方法避免错误,得到正确的结果:
QDateTime  datetime = QDateTime::currentDateTime();
QString  str = datetime.toString("D'a'te:yyyy-MM-ddThh:mm:ss.zzz");
qDebug()<<str<<endl
其中a添加上单引号,防止了被解释成接收参数