How do I convert Unix Milliseconds to a readable format?

I’m fetching the time from an existing database which is in epoch milliseconds (example: 1641842461672). Is there a way I can convert this in Wappler to a human-readable format?

Using .toDate() in the formatter doesn’t seem to work correctly as it always gives the incorrect date since it doesn’t seem to understand the format is in milliseconds.

In PHP I can use

<?php $mil = 1641770868608; $seconds = $mil / 1000; echo date("d-m-Y", $seconds); ?>

but I’m not sure if I can put an app connect expression in this.

Community Page
Last updated: