1、QDateTime 转换为QString
QString strBuffer;
QDateTime time;
time = QDateTime::currentDateTime();
strBuffer = time.toString("yyyy-MM-dd hh:mm:ss");
// strBuffer = 2018-06-06 14:05:00
2、QString 转换为 QDateTime
QString strBuffer;
QDateTime time;
strBuffer = "2018-06-06 14:05:00";
time = QDateTime::fromString(strBuffer, "yyyy-MM-dd hh:mm:ss");
https://blog.csdn.net/coderwu/article/details/5709803
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)