<p>The creation time is recorded in the block:</p>

<p><a href="https://en.bitcoin.it/wiki/Protocol_specification#block" rel="nofollow">https://en.bitcoin.it/wiki/Protocol_specification#block</a></p>

<p>And since there's no benign benefit in deferring announcing it, it would seem likely creation time and announcement time would be pretty close.  But I accept there are variations, and pretty close may not be good enough.</p>

<p>However there is another approach.</p>

<p>You can use the bitcoind/bitcoin-qt -blocknotify option, described here: </p>

<p><a href="http://github.com/bitcoin/bitcoin/pull/743" rel="nofollow">github.com/bitcoin/bitcoin/pull/743</a> </p>

<p>To record the time of new best blocks (which seems to be the like what you want.) </p>

<p>I used </p>

<pre><code>blocknotify=echo date", %s" &gt;&gt; /home/userid/.bitcoin/blocknotify.log 
</code></pre>

<p>And got: </p>

<pre><code>Sun Jun 23 20:14:15 NZST 2013, 0000000000000069a26870e6f6693d733e32d57174bebb7d21f0fac1212fd83b 
Sun Jun 23 20:33:04 NZST 2013, 000000000000003359dff8a8bd1033b02a52c6c2ff3ebb2f8dbffd171c97e83c 
Sun Jun 23 20:43:11 NZST 2013, 000000000000004ec1559bd7e955ce8914a29a04b378bbcc34adf5bea077f73d
</code></pre>

<p>To clarify, that example of blocknotify was in bitcoind.conf, but it works on the command line too, with appropriate quoting of shell significant characters.</p>

CC BY-SA 3.0
2013-06-20T06:25:04.017Z
The timestamp on the block isn't always correct - plenty of examples where sequential blocks do not have sequential timestamps. The times the blocks are announced to the network are more accurate. Sometimes they can be significantly wrong. I'd like to summarise and try to model the error distribution, and for that I need the timestamps and the first time the block was announced.
organofcorti
CC BY-SA 3.0
2013-06-20T07:25:35.603Z
True, but then you're going to encounter variability in "the time announced" as that will differ at different points in the network.  As there's unlikely to be an historical record of announced times, perhaps there's something in the bitcoind log that would at least tell you about local arrival times.
Hamish MacEwan
CC BY-SA 3.0
2013-06-20T07:41:54.687Z
Blockchain.info records the times they receive the block announcement, but then I'd have to use them every time I wanted to update. A local bitcoind running constantly would do it if there's something in the debug log I can regex. I thought there was last time I looked but I'm not sure if it's the received time or not. I'll have to look at the log again.
organofcorti
CC BY-SA 3.0
2013-06-23T09:07:41.673Z
You can use the -blocknotify option, described here:

https://github.com/bitcoin/bitcoin/pull/743

To record the time of new best blocks (which seems to be the like what you want.)

I used

blocknotify=echo `date`", %s" >> /home/userid/.bitcoin/blocknotify.log

And got:

Sun Jun 23 20:14:15 NZST 2013, 0000000000000069a26870e6f6693d733e32d57174bebb7d21f0fac1212fd83b
Sun Jun 23 20:33:04 NZST 2013, 000000000000003359dff8a8bd1033b02a52c6c2ff3ebb2f8dbffd171c97e83c
Sun Jun 23 20:43:11 NZST 2013, 000000000000004ec1559bd7e955ce8914a29a04b378bbcc34adf5bea077f73d
Hamish MacEwan
CC BY-SA 3.0
2013-06-23T09:16:15.483Z
Apologies for the shambles above, editing times out after five minutes and I wasn't familiar with the markdown approach for new lines.  
  
To clarify, that example of blocknotify was in bitcoind.conf, but it works on the command line too, with appropriate quoting of shell significant characters.
Hamish MacEwan
CC BY-SA 3.0
2013-06-27T23:36:35.627Z
Thanks Hamish, sounds like what I'm after. Do you mind re-posting your comment as an answer so I can select and upvote it?
organofcorti
CC BY-SA 3.0
2013-06-30T00:08:00.420Z
Roger that.  On the advice of StackExchange I just edited the first answer.
Hamish MacEwan
CC BY-SA 3.0
2014-05-23T14:11:39.203Z
@HamishMacEwan, Can the creation time of the block be modified?
Pacerier
CC BY-SA 3.0
2013-06-20T06:09:54.910Z
2013-06-30T00:07:09.243Z
2013-06-30T00:07:09.243Z
Hamish MacEwan
<p>Times at which a block is initially announced to the network aren't recorded in the block. Does bitcoind record at least the local time each block was seen the first time? Does anyone have any suggestions about how to record these times?</p>

<p>I'd like to be able to use local data rather than hammer someone else's servers.</p>

<block>
Where are block announce times recorded?
organofcorti
# Where are block announce times recorded?

(Asked by: username_0 on 2013-06-19)

Times at which a block is initially announced to the network aren't recorded in the block. Does bitcoind record at least the local time each block was seen the first time? Does anyone have any suggestions about how to record these times?

I'd like to be able to use local data rather than hammer someone else's servers.

**Tags:** block


---

## 1 answers

### Answer by username_1 on 2013-06-20. Score: 4 | Accepted answer

The creation time is recorded in the block:

<https://en.bitcoin.it/wiki/Protocol_specification#block>

And since there's no benign benefit in deferring announcing it, it would seem likely creation time and announcement time would be pretty close. But I accept there are variations, and pretty close may not be good enough.

However there is another approach.

You can use the bitcoind/bitcoin-qt -blocknotify option, described here:

[github.com/bitcoin/bitcoin/pull/743](http://github.com/bitcoin/bitcoin/pull/743)

To record the time of new best blocks (which seems to be the like what you want.)

I used

```
blocknotify=echo date", %s" >> /home/userid/.bitcoin/blocknotify.log 

```

And got:

```
Sun Jun 23 20:14:15 NZST 2013, 0000000000000069a26870e6f6693d733e32d57174bebb7d21f0fac1212fd83b 
Sun Jun 23 20:33:04 NZST 2013, 000000000000003359dff8a8bd1033b02a52c6c2ff3ebb2f8dbffd171c97e83c 
Sun Jun 23 20:43:11 NZST 2013, 000000000000004ec1559bd7e955ce8914a29a04b378bbcc34adf5bea077f73d

```

To clarify, that example of blocknotify was in bitcoind.conf, but it works on the command line too, with appropriate quoting of shell significant characters.

> **Comments:**
> **username_0**: The timestamp on the block isn't always correct - plenty of examples where sequential blocks do not have sequential timestamps. The times the blocks are announced to the network are more accurate. Sometimes they can be significantly wrong. I'd like to summarise and try to model the error distribution, and for that I need the timestamps and the first time the block was announced.  
> **username_1**: True, but then you're going to encounter variability in "the time announced" as that will differ at different points in the network.  As there's unlikely to be an historical record of announced times, perhaps there's something in the bitcoind log that would at least tell you about local arrival times.  
> **username_0**: Blockchain.info records the times they receive the block announcement, but then I'd have to use them every time I wanted to update. A local bitcoind running constantly would do it if there's something in the debug log I can regex. I thought there was last time I looked but I'm not sure if it's the received time or not. I'll have to look at the log again.  
> **username_1**: You can use the -blocknotify option, described here:  https://github.com/bitcoin/bitcoin/pull/743  To record the time of new best blocks (which seems to be the like what you want.)  I used  blocknotify=echo `date`", %s" >> /home/userid/.bitcoin/blocknotify.log  And got:  Sun Jun 23 20:14:15 NZST 2013, 0000000000000069a26870e6f6693d733e32d57174bebb7d21f0fac1212fd83b Sun Jun 23 20:33:04 NZST 2013, 000000000000003359dff8a8bd1033b02a52c6c2ff3ebb2f8dbffd171c97e83c Sun Jun 23 20:43:11 NZST 2013, 000000000000004ec1559bd7e955ce8914a29a04b378bbcc34adf5bea077f73d  
> **username_1**: Apologies for the shambles above, editing times out after five minutes and I wasn't familiar with the markdown approach for new lines.      To clarify, that example of blocknotify was in bitcoind.conf, but it works on the command line too, with appropriate quoting of shell significant characters.  
> **username_0**: Thanks username_1, sounds like what I'm after. Do you mind re-posting your comment as an answer so I can select and upvote it?  
> **username_1**: Roger that.  On the advice of StackExchange I just edited the first answer.  
> **username_2**: @username_1, Can the creation time of the block be modified?  

---

