Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] truncating the QTime
Lorence last edited by Lorence
qDebug() << iter->getTime_log().time();
Any way to truncate the seconds part of this time?
I want it to be:
qDebug() << "QTime(\"" << iter->getTime_log().time().toString("hh:mm::ss") << "\")";
@SGaist hello, thanks for the reply
can you explain me what is happening in that code?
it ask the time object (from time() ) to convert to a string (ToString) using the format
Since the milliseconds are not listed, they will not be there.
I see @mrjj thanks.
cant i just convert the seconds part of the time to int?
something like this QTime::setSecond(int);
Hmm, dont the format work for you ?
Not sure why you want to do anything to the seconds.
it is working absolutely, but its like a little bit of complicated . okay thanks
well you basically just ask it to use another format.