<p>mediantime is better for your purpose. The timestamp is chosen by the miners, and has some restrictions on it such as it can't be too far in the future/past (no more than 2 hours into the future), but it is not strictly increasing. Mediantime, on the other hand, is. Mediantime is the median time of the past 11 block timestamps, and a block <em>must</em> have a timestamp greater than that median time, so the mediantime always increases. </p>

CC BY-SA 4.0
2020-02-21T04:57:58.497Z
So it's possible to have a higher block with a lower time than a lower block?!
M.K. Safi
CC BY-SA 4.0
2020-02-22T21:58:45.423Z
Correct, as long as it obeys the other rules
meshcollider
CC BY-SA 4.0
2020-04-30T18:24:58.690Z
To add to this answer, it would be good to reference BIP113 which explains a bit more on how GetMedianTimePast is used: https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki
SondreB
CC BY-SA 3.0
2018-01-05T22:18:35.160Z
2018-01-05T22:18:35.160Z
meshcollider
<p>For bitcoin-cli getblock, what's the difference between "time" and "mediantime"?</p>

<p>If i'm looking for a strictly increasing series of timestamps, is one better to choose than the other?</p>

<bitcoind>
Difference between "time" and "mediantime" in getblock?
Edward Kerstein
# Difference between "time" and "mediantime" in getblock?

(Asked by: username_0 on 2018-01-05)

For bitcoin-cli getblock, what's the difference between "time" and "mediantime"?

If i'm looking for a strictly increasing series of timestamps, is one better to choose than the other?

**Tags:** bitcoind


---

## 1 answers

### Answer by username_1 on 2018-01-05. Score: 8 | Accepted answer

mediantime is better for your purpose. The timestamp is chosen by the miners, and has some restrictions on it such as it can't be too far in the future/past (no more than 2 hours into the future), but it is not strictly increasing. Mediantime, on the other hand, is. Mediantime is the median time of the past 11 block timestamps, and a block *must* have a timestamp greater than that median time, so the mediantime always increases.

> **Comments:**
> **username_2**: So it's possible to have a higher block with a lower time than a lower block?!  
> **username_1**: Correct, as long as it obeys the other rules  
> **username_3**: To add to this answer, it would be good to reference BIP113 which explains a bit more on how GetMedianTimePast is used: https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki  

---

