Convert milliseconds to mm:ss.SSS

Hi all,

i am currently trying to convert a JSON File with racing laptimes to a readable format.
I managed to read the JSON, extract the important values and sort them into rows.
The last collumn is the laptime in milliseconds with no leading 0s.
Driver1 | Car | 341068

The last value is the laptime in milliseconds.
Is there any way to convert this direclty into a specific time format? An important information might be, that the length of the number is not fixed. If the track is shorter and a lap time has one digit less, the number is also shorter and doesnt start with a 0.

Hi @EmoJack and welcome to the KNIME community,

Yes milliseconds can be converted to a time using the Unix Timestamp to Date&Time conversion. This works because unix timestamps represent milliseconds (or finer granularity periods) since midnight on 1 Jan 1970 and so if you just convert milliseconds to Time using this, it will effectively convert your milliseconds into a readable time format

Convert milli seconds to time.knwf (7.8 KB)


Hi @takbb - thanks for this. I tried with several time&Date nodes but with no luck.
UNIX time works like a treat. Thanks very much for the quick help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.