How to convert timestamp into date format by using mendix expression?

1
Timestamp = 1590658020461 Date = May 28 2020   
asked
2 answers
3

Hi Shivprasad,

Your timestamp appears to be an amount of milliseconds since the epoch (jan 1, 1970).
You could convtert that to a datetime in Mendix through:

addMilliseconds(dateTimeUTC(1970,1,1), 1590658020461)

For me that seems to give the correct answer: may 28, 2020 9:27:00 (UTC) 

Regards,
Jeroen

answered
3

You can also use the LongToDateTime action in the CommunityCommons module to convert a Unix timestamp to a DateTime object. There is also DateTimeToLong if you need to go the other way.

Hope this helps

answered