i do not have any clue about Java Script and programming at all but i am trying to set up a sim racing dash and the software (MOZA PitHouse) gives me some good opportunities, but the results arend't that great.
The software gives an included Java Script Text Binding command to read out the time left in the session.
Telemetry.get("v1/gameData/SessionTimeLeft").value The Value i get is seconds.
I can choose between different formats, like raw, 0 and also hh:mm:ss:fff The format i want to have is hh:mm:ss. Sadly it is not available and my hour long search of the www wasn't helpful. I tried diffrent Java Script codes i found, but nothing worked. I still added "/60" after "value" to get the minutes, but dind't found a solution to the format.
I hope that someone has an idea and can help me to get the right format or some solution.
Thanks in advance
enter image description here Text Binding window
enter image description here Text Binding window with format
Answer
Try this
(new Date(Telemetry.get("v1/gameData/SessionTimeLeft").value*1000)).toLocaleTimeString()