Using 'round-time' to figure out human readable time?

Hi, is there any way to back out a human readable time (e.g., 01-20-2022 8:21:13pm PST) from the round-time parameter from the indexer?

For example, I get “1641070304” as the value for the ‘round-time’ on a specific transaction. What would this correspond to in the real world?

1 Like

The round time is a UNIX timestamp.
Most time/date libraries from most languages allow such conversions.
You can also google it and find websites that allow for such conversion.

Thanks for the quick reply!

For others having same issue, here is the Python code to convert the round-time in the transaction json to a datetime object :

from datetime import datetime
ts = int(tx['round-time'])
print(datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))
1 Like