Qt3 中有没有办法将 QDateTime 转换为 QString 并返回 QDateTime,以便最终 QDateTime 将包含有关毫秒的信息?
谢谢。
最佳答案
使用 toString
功能。 format 参数确定结果字符串的格式。
例如,以下代码将仅返回秒和毫秒。
QDateTime t = QDateTime::currentDateTime ();
QString s = t.toString("ss:zzz");
附注。您应该考虑将您的代码移植到
Qt4
关于qt - Qt3 中以毫秒为单位的 QDateTime 到 QString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8883229/