Bitcoin Forum
May 09, 2024, 04:19:17 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: ElectrumX JSON-RPC - get timestamp for block  (Read 69 times)
RoxxR (OP)
Full Member
***
Offline Offline

Activity: 208
Merit: 148


View Profile
April 26, 2022, 08:58:59 AM
Merited by hugeblack (3), NeuroticFish (1)
 #1

RPC wizards: How would you get the timestamp of a block (or series of blocks), given the block index(es)?
1715271557
Hero Member
*
Offline Offline

Posts: 1715271557

View Profile Personal Message (Offline)

Ignore
1715271557
Reply with quote  #2

1715271557
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
April 26, 2022, 10:21:06 AM
Merited by hugeblack (4), NeuroticFish (2), ABCbits (1)
 #2

The protocol allows you to call blockchain.block.header(height, cp_height=0) with a block height (index) and get the 80 byte header as bytes. The 4 bytes from 68 to 72 are the block's timestamp in little endian order.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
RoxxR (OP)
Full Member
***
Offline Offline

Activity: 208
Merit: 148


View Profile
April 26, 2022, 08:55:21 PM
 #3

The protocol allows you to call blockchain.block.header(height, cp_height=0) with a block height (index) and get the 80 byte header as bytes. The 4 bytes from 68 to 72 are the block's timestamp in little endian order.

Awesome! Thanks; I'll give this a try
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!