QDate - wrong year

前端 未结 3 902
误落风尘
误落风尘 2021-01-22 01:39

I have the following situation:

   QDate fixDate = QDate::fromString(QString(\"270912\"), \"ddMMyy\");

the year returned is 1912.

3条回答
  •  遥遥无期
    2021-01-22 01:53

    Two-digit year is always interpretating as 19xx. So You can pass YYYY or just add 100 to years.

提交回复
热议问题