I am trying to build a python program, that returns details of a transaction, such as inputs, outputs, time, amount, etc. I have already loaded bitcoind -txindex, yet, when I decode a raw transaction, I do not get the time field. I have already read that decoderawtransaction does not contain the time of the transaction, but I am curious of the way btc explorers get those data?

The only time fields that I have found are in getblock command and in getrawmempool/getmempoolentry (although I do not focus on unconfirmed transaction). Can i get any info from them?

Thank you for your time.

  • 1
    pretty sure that doesn't really exist... block explorers probably write the time to an external DB the moment they receive a transaction on their node(s) Commented Dec 11, 2023 at 20:27

1 Answer 1


As you have found, there are no time fields in transaction data.

Blocks have a timestamp but that can be up to 2 hours out.

Nodes can of course choose to record the time at which they first saw a transaction, this might be during relaying of transactions before the transaction is confirmed by being added to a block by a miner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.