DateTime/timestamp of the transaction

How can I get the DateTime/timestamp of the transaction?

There is a timestamp field in the transaction JSON returned by the APIs that return transactions

hello, thank you for your answer but I don't understand how to get this date [8/21/2021 22:04:15] from
this response


is the timestamp expressed in seconds?

Yes, timestamp is number of seconds since the epochBeginning. The epochBeginning is returned by the getConstants API and is in milliseconds since 1 January 1970 UTC. On mainnet epochBeginning represents 2018-01-01 00:00:00 and on testnet 2017-12-26 14:00:00.

Check the function NRS.fromEpochTime in nrs.util.js about how to convert from Ardor timestamp to the milliseconds since 1 January 1970 UTC format, which can then be used to create a new javascript Date object and then e.g. print it as string.

Hi, I got the "epochBeginning" from my server's constants, How can I convert timestamp to the correct date from getTransaction response via API. I'm using xamarin in developing my app.

I think there is missing in my conversion coz it is giving an incorrect transaction date.

Just add the epoch beginning (milliseconds) to the transaction timestamp (seconds) adjusting to the desired unit and convert that. The specific conversion will depend on your language and platform.

@sergi and @petko.petkov Thanks, Got the correct date now! :blush::blush::blush::blush: