Bitcoin Forum
May 11, 2024, 05:02:49 AM *
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)?
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715403769
Hero Member
*
Offline Offline

Posts: 1715403769

View Profile Personal Message (Offline)

Ignore
1715403769
Reply with quote  #2

1715403769
Report to moderator
1715403769
Hero Member
*
Offline Offline

Posts: 1715403769

View Profile Personal Message (Offline)

Ignore
1715403769
Reply with quote  #2

1715403769
Report to moderator
1715403769
Hero Member
*
Offline Offline

Posts: 1715403769

View Profile Personal Message (Offline)

Ignore
1715403769
Reply with quote  #2

1715403769
Report to moderator
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!