BITCOIN MAINNETLive explorer status
THE SHARED RECORD

Block timestamps

Miners set each block's timestamp within two rules: later than the median of the last 11 blocks, and at most 2 hours in the future. Learn why.

Miners choose the time

The header has a 4-byte Unix timestamp chosen by the miner. Computers' clocks differ, so the rules are loose but bounded:

  • It must be greater than the median time of the previous 11 blocks ("median time past").
  • A node won't accept it if it is more than 2 hours ahead of the node's own network-adjusted time.

Consequences

  • Block times can appear out of order: block 101 can show an earlier time than block 100.
  • The gap between blocks shown in an explorer is approximate.
  • Timelocks based on time use median time past, not the latest block's own timestamp, so a single miner can't move them.
Median time past uses the middle value of the last 11 block times10:02Block 110:15Block 210:11Block 310:24Block 410:31Block 5
Median time past uses the middle value of the last 11 block times

Why timestamps matter

Difficulty adjustment uses timestamps to measure how long the last 2,016 blocks took. Rules prevent extreme manipulation, so the schedule stays close to 10 minutes per block over time.

Why not use exact time?

There is no trusted clock on a decentralised network. Each node has its own clock, and they drift. Loose rules plus the median of past blocks give a timestamp that is good enough for difficulty adjustment and timelocks while being impossible for one miner to move far.

The year 2106 problem

The timestamp is an unsigned 32-bit number of seconds since 1970, so it runs out in the year 2106. Fixing it will need a change long before then; there is plenty of time.

Share this guide
Share on X ↗

Key takeaways

  • Miners set block timestamps within limits.
  • A block's time must exceed the median of the previous 11 blocks.
  • Time-based locks use median time past.

Common questions

Can a block have an earlier time than its parent?

Yes, as long as it's still above the median of the previous 11 blocks.

Why does my explorer show a block 'from the future'?

Its miner's clock was slightly ahead, which is allowed up to two hours.

Are block timestamps accurate?

Usually within minutes, but they can be off by up to two hours and can even appear out of order.

What is median time past?

The median timestamp of the previous 11 blocks, used as a stable clock for timelocks.