Hello,
I getting a timesatamp from an Hardware and have to convert it in format (sss.zzz) where s is second and z is millsecond.
I tried with the format(h:m:sss.zzz) I am getting the correct data but I don't want minute to display it should be second and millisecond and it should be in 3 digit.
If I have a code
QString timeString
= time.
toString();
time.setHMS(0,0,0,0);
time1 = time.addMSecs(Time_ecu2uss[1]);//where Time_ecu2uss[i] contain the timestamp
timeString = time1.toString("m:ss.zzz");
qDebug()<<timeString ;
QTime time,time1;
QString timeString = time.toString();
time.setHMS(0,0,0,0);
time1 = time.addMSecs(Time_ecu2uss[1]);//where Time_ecu2uss[i] contain the timestamp
timeString = time1.toString("m:ss.zzz");
qDebug()<<timeString ;
To copy to clipboard, switch view to plain text mode
It display the time in 0:00:000 format but I want in 000:000 format
I tired to display like below
QString timeString
= time.
toString();
time.setHMS(0,0,0,0);
time1 = time.addMSecs(Time_ecu2uss[1]);//where Time_ecu2uss[i] contain the timestamp
timeString = time1.toString("sss.zzz");
qDebug()<<timeString ;
QTime time,time1;
QString timeString = time.toString();
time.setHMS(0,0,0,0);
time1 = time.addMSecs(Time_ecu2uss[1]);//where Time_ecu2uss[i] contain the timestamp
timeString = time1.toString("sss.zzz");
qDebug()<<timeString ;
To copy to clipboard, switch view to plain text mode
I am getting the format but wrong time.
Bookmarks