<h2>Displayed precision ≠ Stored precision</h2>
<p>Note that the block timestamp is stored as a 4-byte number of <strong>seconds</strong> since 1970-01-01T00:00 UTC (the Unix epoch). However Blockchain.com show this in a more human readable form rounded or truncated to the nearest <strong>minute</strong> (2011-05-21 18:26). So if you convert that human readable time back to an integer, you will get a value that is different by a number of seconds between 0 and 59</p>
<h2>Endianness</h2>
<p>See Wikipedia article on <a href="https://en.wikipedia.org/wiki/Endianness" rel="nofollow noreferrer">endianness</a>. There are two possible orderings of the bytes of a multi-byte integer. You can start with least significant byte (LSB) or with most significant byte (MSB). Internet standard &quot;Network Order&quot; is big-endian. X86 architecture computers use little-endian byte-order. Some other hardware architectures use big-endian byte-order.</p>
<h2>Bitcoin</h2>
<p>Bitcoin mostly uses little endian. Even for data transmitted over the Internet. See <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow noreferrer">documentation for block hashing</a>. Note that it talks about the use of big-endian for hexadecimal display of values and little-endian for storage.</p>
<h2>Timestamps are not accurate</h2>
<p>See <a href="https://bitcoin.stackexchange.com/q/915/13866">Why don&#39;t the timestamps in the block chain always increase?</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. &quot;Network-adjusted time&quot; is the median of the timestamps returned by all nodes connected to you.</p>
</blockquote>
<p>So don't be surprised if later blocks sometimes have earlier timestamps. Children can be older than their parents.</p>

CC BY-SA 4.0
2021-10-14T11:24:47.590Z
Thank you for the info. can you help me where can i get the correct time stamp with seconds for any block
V01
CC BY-SA 4.0
2021-10-14T11:44:29.527Z
E.g. [Blockstream](https://blockstream.info/block/00000000000000000001f83317535a1d6879be546a3faf11661d5903e821e3b1) gives seconds.  Remember that block timestamps are not meant to be an accurate representation of the time a block was created, they can vary from actual time by an hour or more. Miners can tweak them as an extra nonce. Miners don't have to keep accurate time.
RedGrittyBrick
CC BY-SA 4.0
2021-10-14T12:33:31.240Z
wow so timestamp is also a parameter that miners have the control? and it can be used as extra nonce? that's interesting
V01
CC BY-SA 4.0
2021-10-15T12:11:41.167Z
Thank you i again worked considering the timestamp with including seconds

and i got blockheader like
0100000081cd02ab7e569e8bcd9317e2fe99f2de44d49ab2b8851ba4a308000000000000e320b6c2fffc8d750423db8b1eb942ae710e951ed797f7affc8892b0f1fc122bc7f5d74df2b9441a42a14695 
same as the 125552 showed in link
https://en.bitcoin.it/wiki/Block_hashing_algorithm

when i applied double hash to it using https://xorbin.com/tools/sha256-hash-calculator

i am not getting same result
can you please help me
V01
CC BY-SA 4.0
2021-10-15T14:37:34.450Z
This website works best when you ask one question at a time so It would probably best if you ask a [new question](https://bitcoin.stackexchange.com/questions/ask) showing exactly what you want to do, how you did the calculations and exactly how the results differ from what you expected. In your new question you can include a link back to this one if you think it will help people understand your new question.
RedGrittyBrick
CC BY-SA 4.0
2021-10-15T14:48:12.347Z
Yeah i think you correct sir, Thank you i will ask a new questions
V01
CC BY-SA 4.0
2021-10-14T08:33:01.777Z
2021-10-14T11:49:10.940Z
2021-10-14T11:49:10.940Z
RedGrittyBrick
<p>I am just learning mining process.
Today I learned that we have to find nonce for given block header.</p>
<p>And for block header we need timestamp in UTC</p>
<p>I took the timestamp data from below link of 125552 block
<a href="https://www.blockchain.com/btc/block/00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d" rel="nofollow noreferrer">https://www.blockchain.com/btc/block/00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d</a></p>
<p>And used the below linke to convert it from UTC to seconds
<a href="https://www.epochconverter.com/" rel="nofollow noreferrer">https://www.epochconverter.com/</a></p>
<p>And I am getting 1305998760</p>
<p>But according to the example in the below link its 1305998791
<a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Block_hashing_algorithm</a></p>
<p>And what is endian in the above link</p>
<p>Can anyone please help me what am I missing</p>
<p>Thanks in advance</p>

<mining-theory><block-header><nonce><timestamp><endianness>
What is the correct way to calculate timestamp for a Block(125552)?
V01
# What is the correct way to calculate timestamp for a Block(125552)?

(Asked by: username_0 on 2021-10-14)

I am just learning mining process.
Today I learned that we have to find nonce for given block header.

And for block header we need timestamp in UTC

I took the timestamp data from below link of 125552 block
<https://www.blockchain.com/btc/block/00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d>

And used the below linke to convert it from UTC to seconds
<https://www.epochconverter.com/>

And I am getting 1305998760

But according to the example in the below link its 1305998791
<https://en.bitcoin.it/wiki/Block_hashing_algorithm>

And what is endian in the above link

Can anyone please help me what am I missing

Thanks in advance

**Tags:** mining-theory, block-header, nonce, timestamp, endianness


---

## 1 answers

### Answer by username_1 on 2021-10-14. Score: 2 | Accepted answer

## Displayed precision ≠ Stored precision

Note that the block timestamp is stored as a 4-byte number of **seconds** since 1970-01-01T00:00 UTC (the Unix epoch). However Blockchain.com show this in a more human readable form rounded or truncated to the nearest **minute** (2011-05-21 18:26). So if you convert that human readable time back to an integer, you will get a value that is different by a number of seconds between 0 and 59

## Endianness

See Wikipedia article on [endianness](https://en.wikipedia.org/wiki/Endianness). There are two possible orderings of the bytes of a multi-byte integer. You can start with least significant byte (LSB) or with most significant byte (MSB). Internet standard "Network Order" is big-endian. X86 architecture computers use little-endian byte-order. Some other hardware architectures use big-endian byte-order.

## Bitcoin

Bitcoin mostly uses little endian. Even for data transmitted over the Internet. See [documentation for block hashing](https://en.bitcoin.it/wiki/Block_hashing_algorithm). Note that it talks about the use of big-endian for hexadecimal display of values and little-endian for storage.

## Timestamps are not accurate

See [Why don't the timestamps in the block chain always increase?](https://bitcoin.stackexchange.com/q/915/13866)

> 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. "Network-adjusted time" is the median of the timestamps returned by all nodes connected to you.

So don't be surprised if later blocks sometimes have earlier timestamps. Children can be older than their parents.

> **Comments:**
> **username_0**: Thank you for the info. can you help me where can i get the correct time stamp with seconds for any block  
> **username_1**: E.g. [Blockstream](https://blockstream.info/block/00000000000000000001f83317535a1d6879be546a3faf11661d5903e821e3b1) gives seconds.  Remember that block timestamps are not meant to be an accurate representation of the time a block was created, they can vary from actual time by an hour or more. Miners can tweak them as an extra nonce. Miners don't have to keep accurate time.  
> **username_0**: wow so timestamp is also a parameter that miners have the control? and it can be used as extra nonce? that's interesting  
> **username_0**: Thank you i again worked considering the timestamp with including seconds  and i got blockheader like 0100000081cd02ab7e569e8bcd9317e2fe99f2de44d49ab2b8851ba4a308000000000000e320b6c2fffc8d750423db8b1eb942ae710e951ed797f7affc8892b0f1fc122bc7f5d74df2b9441a42a14695  same as the 125552 showed in link https://en.bitcoin.it/wiki/Block_hashing_algorithm  when i applied double hash to it using https://xorbin.com/tools/sha256-hash-calculator  i am not getting same result can you please help me  
> **username_1**: This website works best when you ask one question at a time so It would probably best if you ask a [new question](https://bitcoin.stackexchange.com/questions/ask) showing exactly what you want to do, how you did the calculations and exactly how the results differ from what you expected. In your new question you can include a link back to this one if you think it will help people understand your new question.  
> **username_0**: Yeah i think you correct sir, Thank you i will ask a new questions  

---

