[SOLVED] truncating the QTime
-
qDebug() << iter->getTime_log()[0].time();
Output
QTime("08:34:40.244")Any way to truncate the seconds part of this time?
I want it to be:
QTime("08:34:40") -
Hi,
qDebug() << "QTime(\"" << iter->getTime_log()[0].time().toString("hh:mm::ss") << "\")";
-
@SGaist hello, thanks for the reply
can you explain me what is happening in that code? -
@Lorence
it ask the time object (from time() ) to convert to a string (ToString) using the format
hours:minutes:seconds.
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);
-
@Lorence
Hmm, dont the format work for you ?
Not sure why you want to do anything to the seconds. -
@mrjj
it is working absolutely, but its like a little bit of complicated . okay thanks -
@Lorence
well you basically just ask it to use another format. -