# 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.

Canonical page: https://mybitcoinexplorer.com/learn/block-timestamps
Topic: Blocks and the blockchain
Published: 2026-10-29
Updated: 2026-10-30


## Miners choose the time
The [header](https://mybitcoinexplorer.com/learn/block-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.

> Diagram: Median time past uses the middle value of the last 11 block times — 10:02:Block 1,10:15:Block 2,10:11:Block 3,10:24:Block 4,10:31:Block 5

## Why timestamps matter
[Difficulty adjustment](https://mybitcoinexplorer.com/learn/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.


## 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.

## Related lessons

- [The block header](https://mybitcoinexplorer.com/learn/block-header)
- [Difficulty adjustment](https://mybitcoinexplorer.com/learn/difficulty-adjustment)
- [Locktime and sequence](https://mybitcoinexplorer.com/learn/locktime-and-sequence)
- [Timelocks: CLTV and CSV](https://mybitcoinexplorer.com/learn/timelocks-cltv-csv)
