<p>Blocks have timestamps, transactions don't. The time of a block creation is known, the time of the transaction can only be guessed. Most clients use the block's time for transactions, and if they're still in the transaction mempool (not in a block) they use the time the transaction was first seen by the client.</p>

CC BY-SA 3.0
2013-05-02T23:19:27.760Z
So you say that when a transaction gets confirmed, the time value changes to the block time value?
Steven Roose
CC BY-SA 3.0
2013-05-02T23:33:50.427Z
That's client specific behavior, as transaction times play no role in the bitcoin network. But yeah, in this case that seems likely. Test it yourself though: go to blockchain.info, pick a few transactions that are currently unconfirmed and get the time value for them. Then get them again in like an hour or so.
Tom van der Woerdt
CC BY-SA 3.0
2014-05-23T14:02:55.840Z
@TomvanderWoerdt, But doesn't that mean that every single node will have different timestamps because they *receive* the broadcast at different times?
Pacerier
CC BY-SA 3.0
2014-05-23T16:31:03.423Z
@Pacerier Yes, it does
Tom van der Woerdt
CC BY-SA 3.0
2014-05-23T16:32:14.507Z
@TomvanderWoerdt, Please also see http://bitcoin.stackexchange.com/q/25542/1475
Pacerier
CC BY-SA 3.0
2013-05-02T23:18:05.270Z
2013-05-02T23:18:05.270Z
Tom van der Woerdt
<p>Both transactions and blocks have a <code>time</code> field when you use Bitcoin's <code>getblock</code> or <code>gettransaction</code> methods. The <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow">API method list</a> defines the transaction time as " time the transaction occurred".</p>

<p>Is this the time the transaction or block arrived at my client? Or is this time defined by the sender of the transaction or block?</p>

<p>I tried to encode a transaction to a raw transaction and decode it again afterwards, but the <code>lock_time</code> property is set to <code>0</code> when I do this.</p>

<p>The reason for this question is that I want to make sure that when you check all transactions twice, all new ones of the second check have a time value higher than the highest one of the first check.</p>

<transactions><block><api><time><locktime>
Is the time value in transaction or block information the time it arrived at my client?
Steven Roose
# Is the time value in transaction or block information the time it arrived at my client?

(Asked by: username_0 on 2013-05-02)

Both transactions and blocks have a `time` field when you use Bitcoin's `getblock` or `gettransaction` methods. The [API method list](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list) defines the transaction time as " time the transaction occurred".

Is this the time the transaction or block arrived at my client? Or is this time defined by the sender of the transaction or block?

I tried to encode a transaction to a raw transaction and decode it again afterwards, but the `lock_time` property is set to `0` when I do this.

The reason for this question is that I want to make sure that when you check all transactions twice, all new ones of the second check have a time value higher than the highest one of the first check.

**Tags:** transactions, block, api, time, locktime


---

## 1 answers

### Answer by username_1 on 2013-05-02. Score: 3

Blocks have timestamps, transactions don't. The time of a block creation is known, the time of the transaction can only be guessed. Most clients use the block's time for transactions, and if they're still in the transaction mempool (not in a block) they use the time the transaction was first seen by the client.

> **Comments:**
> **username_0**: So you say that when a transaction gets confirmed, the time value changes to the block time value?  
> **username_1**: That's client specific behavior, as transaction times play no role in the bitcoin network. But yeah, in this case that seems likely. Test it yourself though: go to blockchain.info, pick a few transactions that are currently unconfirmed and get the time value for them. Then get them again in like an hour or so.  
> **username_2**: @username_1, But doesn't that mean that every single node will have different timestamps because they *receive* the broadcast at different times?  
> **username_1**: @username_2 Yes, it does  
> **username_2**: @username_1, Please also see http://bitcoin.stackexchange.com/q/25542/1475  

---

