Convert integer to a time format

Can someone help me to transform an integer value into a time?
I use this:

{{new Date(Math.round($json[“data”] - 25569) * 86400 * 1000)}}

to transform value to a date and it works fine.
I have value=0.3333333333333333, which is actually a time=08:00:00.
How does javascript look like to get 08:00:00?

Also, how do you guys set a format of time and dates? For example, I have an output (from a date transformation above) “2023-05-02T20:00:00.000-04:00”. What if I want to transform it to “2023-05-02”?

Seems like I found the solution with ChatGPT, so just leaving a solution here if somewhen someone will need it:

{{new Date(Math.floor($json[“data”] * 86400) * 1000).toISOString().substr(11, 8)}}

4 Likes

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