How can I format UNIX time in milliseconds?

Example unix time in miliseconds is 1528470720000. all records returning smilar format from API . I cant use dateformat …

{{scAssets.data.api1.data.timestamp.formatDate("dd MM yyyy HH:mm:ss")}}

can you guide me @Teodor if you are available ?

Hello Serhat,
Do you want to convert Unix timestamp to milliseconds, or do you have the time in milliseconds and want to convert it to something else?
Can you provide an example of what needs to be converted to what?

I need to like this format or smilar “Fri Jun 08 2018 15:12:00”

Serhat, do you receive your dates in milliseconds and want to convert them to a human readable date, or are you trying to do something else?
Please take a few more seconds to explain what do you need to do exactly.

If you want to convert milliseconds to seconds, you just need to divide the time value by 1000. Then with the epoch time in seconds you should be able to format your date.

Serhat, do you receive your dates in milliseconds and want to convert them to a human readable date, or are you trying to do something else?

yes Teodor , I need human readable format …
my syntax ;
{{(assetsDetails.data.api1.data.timestamp / 1000).formatDate(“dd MM yyyy HH:mm”)}}

console log
Formatter formatDate doesn’t exist for type number

You need to format your number value to date, before applying date formatting to it.

could you write me example ?

Well, just use the To Date formatter.

1 Like

thank you @Teodor

Was working through this and wanted to provide an updated example of epoch conversion…

Here is a source input: 1615744781
timestamp.toNumber().toDate().toUTCDate()

outputs to…
2021-03-14T17:59:41.000Z

For additional formatting…just add formatDate to the end…
timestamp.toNumber().toDate().toUTCDate().formatDate(“dd-MM-yyyy HH:mm:ss”)

outputs to…
03-14-2021 13:59:41