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
Qt Code:
  1. QTime time,time1;
  2. QString timeString = time.toString();
  3.  
  4. time.setHMS(0,0,0,0);
  5. time1 = time.addMSecs(Time_ecu2uss[1]);//where Time_ecu2uss[i] contain the timestamp
  6. timeString = time1.toString("m:ss.zzz");
  7. 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
Qt Code:
  1. QTime time,time1;
  2. QString timeString = time.toString();
  3.  
  4. time.setHMS(0,0,0,0);
  5. time1 = time.addMSecs(Time_ecu2uss[1]);//where Time_ecu2uss[i] contain the timestamp
  6. timeString = time1.toString("sss.zzz");
  7. qDebug()<<timeString ;
To copy to clipboard, switch view to plain text mode 
I am getting the format but wrong time.