<p>A miner applies their own timestamp to a block.</p>

<p>Nodes add <strong>the first block they receive</strong> to the top their chain. They will not replace the current tip of their chain with a newly received block just because it has an earlier timestamp.</p>

<p>Therefore, you can think timestamp is a rough indicator of when the block was formed by the miner.</p>

<hr>

<p>From <a href="https://en.bitcoin.it/wiki/Block_timestamp" rel="noreferrer">bitcoin.it/wiki/Block_timestamp</a>:</p>

<blockquote>
  <p>A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours.</p>
</blockquote>

<p>So I suppose a miner can insert a "fake" timestamp, insomuch that it is between these two bounds. Nonetheless, a "fake" timestamp will not influence its position in the blockchain.</p>

CC BY-SA 3.0
2016-09-22T13:04:34.413Z
do you know where is the bitcoin code is the function that checks this?
smatthewenglish
CC BY-SA 3.0
2016-09-22T16:44:00.627Z
This information is from 2011, it still applies now in 2016?
smatthewenglish
CC BY-SA 3.0
2016-10-08T15:20:26.573Z
@s.matthew.english: Yes, this information is still accurate.
Murch
CC BY-SA 3.0
2018-01-14T21:25:11.250Z
@Murch Can fake time be used to drop the difficulty?
Ilya Gazman
CC BY-SA 3.0
2018-01-15T05:11:31.580Z
@Ilya_Gazman: Yes, but only in limited fashion. See https://bitcoin.stackexchange.com/a/1588/5406, https://bitcoin.stackexchange.com/q/20479/5406
Murch
CC BY-SA 3.0
2016-09-22T11:43:37.383Z
2016-09-22T11:48:42.127Z
2016-09-22T11:48:42.127Z
inersha
<p>A <a href="https://en.wikipedia.org/wiki/White_stork#Storks_and_childbirth" rel="noreferrer">stork brings them</a>... or...</p>

<p>One of the basic principles on a dist. system is <a href="https://en.wikipedia.org/wiki/Distributed_computing" rel="noreferrer">lack of a global clock</a>. </p>

<p>So how are the timestamps assigned to blocks, by the machine that mines it? Couldn't it just insert a fake one? </p>

<p>On page 7 of the <a href="https://github.com/ethereum/wiki/wiki/White-Paper" rel="noreferrer">Ethereum whitepaper</a> Vitalik says that the algorithm for checking that a block is valid contains the following check: </p>

<p><code>Check that the timestamp of the block is greater than that of the [median of the 11 previous blocks] and less than 2 hours into the future</code></p>

<p>So then this notion of time in BTC is quite fuzzy isn't it? </p>

<p>Is there anything I can read that will tell me the exact time bounds of the BTC system? </p>

CC BY-SA 3.0
2016-09-22T11:33:26.877Z
See the accepted answer to the question here:
https://bitcoin.stackexchange.com/questions/915/why-dont-the-timestamps-in-the-block-chain-always-increase
Bjarne Magnussen
CC BY-SA 3.0
2016-09-22T16:44:11.893Z
This information is from 2011, it still applies now in 2016?
smatthewenglish
CC BY-SA 3.0
2016-09-23T10:22:28.857Z
It still applies. It's part of consensus code: of one node across different blocks than another that's going to be messy. This makes it hard to change.
Jannes
CC BY-SA 3.0
2016-09-23T12:45:53.003Z
@Jannes thank you for the heads up. how about the timestamping on Ethereum, I guess it's somehow different- need to read the GHOST paper- do you know about litecoin?
smatthewenglish
CC BY-SA 3.0
2016-09-27T13:23:34.457Z
@s.matthew.english Don't know anything about Ethereum. In general there's no other way to do rough timestamps in a decentralized trustless way (we wouldn't need miners at all). Requiring higher precission timestamps would have been possible, but it makes miners more vulnerable to attack/human error by making them depend on properly configured and working (not DOSsed or manipulated) NTP. I'm not sure about Litecoin, but I doubt they changed anything other than going from 10 minutes to 2.5 minutes block time. Which by itself doesn't make their timestamps any more accurate or more trustworthy.
Jannes
<timestamp>
where do the timestamps on blocks come from?
smatthewenglish
# where do the timestamps on blocks come from?

(Asked by: username_0 on 2016-09-22)

A [stork brings them](https://en.wikipedia.org/wiki/White_stork#Storks_and_childbirth)... or...

One of the basic principles on a dist. system is [lack of a global clock](https://en.wikipedia.org/wiki/Distributed_computing).

So how are the timestamps assigned to blocks, by the machine that mines it? Couldn't it just insert a fake one?

On page 7 of the [Ethereum whitepaper](https://github.com/ethereum/wiki/wiki/White-Paper) Vitalik says that the algorithm for checking that a block is valid contains the following check:

`Check that the timestamp of the block is greater than that of the [median of the 11 previous blocks] and less than 2 hours into the future`

So then this notion of time in BTC is quite fuzzy isn't it?

Is there anything I can read that will tell me the exact time bounds of the BTC system?

**Tags:** timestamp

> **Comments:**
> **username_1**: See the accepted answer to the question here: https://bitcoin.stackexchange.com/questions/915/why-dont-the-timestamps-in-the-block-chain-always-increase  
> **username_0**: This information is from 2011, it still applies now in 2016?  
> **username_2**: It still applies. It's part of consensus code: of one node across different blocks than another that's going to be messy. This makes it hard to change.  
> **username_0**: @username_2 thank you for the heads up. how about the timestamping on Ethereum, I guess it's somehow different- need to read the GHOST paper- do you know about litecoin?  
> **username_2**: @s.matthew.english Don't know anything about Ethereum. In general there's no other way to do rough timestamps in a decentralized trustless way (we wouldn't need miners at all). Requiring higher precission timestamps would have been possible, but it makes miners more vulnerable to attack/human error by making them depend on properly configured and working (not DOSsed or manipulated) NTP. I'm not sure about Litecoin, but I doubt they changed anything other than going from 10 minutes to 2.5 minutes block time. Which by itself doesn't make their timestamps any more accurate or more trustworthy.  

---

## 1 answers

### Answer by username_3 on 2016-09-22. Score: 5 | Accepted answer

A miner applies their own timestamp to a block.

Nodes add **the first block they receive** to the top their chain. They will not replace the current tip of their chain with a newly received block just because it has an earlier timestamp.

Therefore, you can think timestamp is a rough indicator of when the block was formed by the miner.

---

From [bitcoin.it/wiki/Block\_timestamp](https://en.bitcoin.it/wiki/Block_timestamp):

> A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours.

So I suppose a miner can insert a "fake" timestamp, insomuch that it is between these two bounds. Nonetheless, a "fake" timestamp will not influence its position in the blockchain.

> **Comments:**
> **username_0**: do you know where is the bitcoin code is the function that checks this?  
> **username_0**: This information is from 2011, it still applies now in 2016?  
> **username_4**: @s.matthew.english: Yes, this information is still accurate.  
> **username_5**: @username_4 Can fake time be used to drop the difficulty?  
> **username_4**: @Ilya_Gazman: Yes, but only in limited fashion. See https://bitcoin.stackexchange.com/a/1588/5406, https://bitcoin.stackexchange.com/q/20479/5406  

---

